A Discord Bot that curbs the spread of unverified image in a Discord Server, with a special focus on security.
Contributors: Kyzyl, Kinshu, Srija, Nishtha Singhal and Nishtha Ahuja
- Limits number of times an image can be forwarded.
- Role based information verification.
- Readers are cautioned when edited images are sent.
- Install dependencies and genereate private and public keys
- Authorize access to your server follow steps at https://realpython.com/how-to-make-a-discord-bot-python/
- Add
.env
file with DISCORD_TOKEN= 'app_token' - Run the bot
pip install discord.py dotenv python-dotenv pillow pycryptodomex numpy
python generateKey.py
python bot.py
To do his job Mitnick employs the following techniques:
- image steganography - LSB
- integrity check using hashing - SHA256
- Cryptosystem - RSA
Every time an image is sent:
if(checkIfHashPresent(image) == False):
# hash not present .... i.e. new image
nof = 0
source = message.author.id
#now storing message in image, hashing, encrypting hash and then appending to image
stego.Encode(image, nof + source)
hashToBeStored = Hash(image)
encryptedHash = RSA.encrypt(hashToBeStored, publicKey)
appendToImage(encryptedHash, image)
else:
#hash present
if(checkIfHashValid(image) == True):
#hash verified, integrity maintained
nof, source = stego.decode(image)
if(nof>5):
#ignore image sent more than 5 times
break
nof++
#now storing message in image, hashing, encrypting hash and then appending to image
stego.Encode(image, nof + source)
hashToBeStored = Hash(image)
encryptedHash = RSA.encrypt(hashToBeStored, publicKey)
appendToImage(encryptedHash, image)
else:
# hash not valid ...edited image... give caution... treat as new image
nof = 0
source = message.author.id
#now storing message in image, hashing, encrypting hash and then appending to image
stego.Encode(image, nof + source)
hashToBeStored = Hash(image)
encryptedHash = RSA.encrypt(hashToBeStored, publicKey)
appendToImage(encryptedHash, image)