transparent slack message anonymizer
| Before | After |
|---|---|
Caution
This will project can apply PERMANENT CHANGES to your slack messages. Make sure to read the documentation before using it and consider testing it on a test workspace first.
Requires Python 3.12+
uv tool install hades-slackCheck it out on PyPI: https://pypi.org/project/hades-slack
Slack has a funny thing called ratelimiting so we need multiple apps so this doesn't take 5 and a half years to complete.
This is automated and needs an "App Configuration Token" from Slack. How do you get one?
- Go to https://api.slack.com/apps
- Scroll down to "Your App Configuration Tokens"
- Click "Generate Token"
- Copy the "Access Token" that is generated
hades create-apps APP_CONFIG_TOKEN_HEREThis will create 5 slack apps and save their credentials. (The amount can be changed with the --count flag.)
What we actually need are user tokens for each app. To get those, run:
hades install-appsThis will open a browser window for each app and ask you to authorize it. After authorizing all apps, the user tokens will be saved to apps.json.
Before any operation, you will need to make a full download of your messages. This is done with:
hades download YOUR_USER_ID_HERE --apps apps.jsonThis will use the apps you created to download all your messages and save them to slack_messages.db.
Use --resume to continue a previously interrupted download.
Use --purge to delete any existing messages in the database before downloading.
Now that you have your messages downloaded, you can see some stats about them with:
hades statsTo encrypt your messages, run:
hades encrypt YOUR_PASSWORD_HERE ENCRYPT_OLDER_THAN --apps apps.json --executeENCRYPT_OLDER_THAN is the amount of days old a message has to be to be encrypted. For example, 30 will encrypt all messages older than 30 days and 0 will encrypt all messages.
Removing the --execute flag will do a dry run and show you how many messages would be encrypted without actually encrypting them on Slack.
Use --mode to control what replaces your message text:
text(default): Replace with custom text via--text(default:[anonymized with hades])random: Replace with random hex stringinvisible: Make the message invisibleredact: Replaces non space characters with asterisks (*)
Use --channel-type / -c to filter which types of channels to encrypt. Can be repeated for multiple types.
public(default): Public channelsprivate: Private channelsdm: Direct messagesgdm: Group direct messages
For example, to encrypt messages in DMs and private channels older than 30 days, run:
hades encrypt YOUR_PASSWORD_HERE 30 --apps apps.json -c dm -c private --executeTo decrypt your messages you will need to have a fresh download of your messages (run the download command again) and then run:
hades decrypt YOUR_PASSWORD_HERE DECRYPT_YOUNGER_THAN --apps apps.json --executeDECRYPT_YOUNGER_THAN is the amount of days old a message has to be to be decrypted. For example, 30 will decrypt all messages younger than 30 days and 0 will decrypt all messages.
Removing the --execute flag will do a dry run and show you how many messages would be decrypted without actually decrypting them on Slack.