Package: mersad
Mersad Cryptography LibraryA side project of a Telecommunication student who loves ciphers.If you want to do any serious jobs :poop: with this tool, prepare yourself to get fired :fire:!Why is Gamora?In summer 2019 I had decided to practice Python and DevOps tasks like: continuous
integration and automated releasing software to packaging sources like pypi, I don't
know how I ended up here writing this for you!
(even like if there is any "you" out there looking at this little side project of mine.)So if you want to send unbreakable messages to your friends with ancient algorithms
without using pen and paper, Mersad can help you. (but seriously, :joy: unbreakable? c'mon!)Oh and I :heart: codes and ciphers!Quick startI'm sure you have worked with Python before and you are familiar with how to download
and install packages using pip, so here is how to install this totally (not at all)
secure package:# 1. if you are an uncivilised savage living in a hell of dependency conflicts who doesn't# even heard of virtual environments and always install packages in sudo mode, here you go:sudo-Hpip3installmersad# or just use a little bit better non-sudo thingpip3install--usermersad# 2. if you are a man of culture, activate your virtual environment and type this:pip3installmersad# pipenv is also a good thing to use (only heroes use itpipenvinstallmersadWait a second, What's Cryptography?Honestly? I don't know either ... :grimacing:. smart guys gather together to invent
a way for communicating with their lovers in secret and other (literally) more smart
guys will try to find a way to break their code and read their love messages
(they succeed), but they are enough stupid to tell everyone about it, so first group
will try to find new encryption algorithms for their messages. This never ending
cycle continues until today.Apparently people are calling the work of first group (designing encryption algorithms)
"Cryptography" and the work of second group (breaking those stupid ciphers) "Cryptanalysis".How does this package work?Good question, it doesn't.But if you are so smart and managed to make it work for you, here is some
explanation about the mess that is going on:Mersad is divided into two main sub-packages,classicalandmodern, I'm currently
developing classical algorithms but in future I will start working on modern ones.I'm also planning to addcryptanalysismodule, this module will contains programs
to break ciphers.Each cipher has a class and a translator function, you can use any of them or both of
them together.
the translator function is no memory and requires every argument in
each call but class have memory and can store key, alphabet and etc.ExampleIt is a very simple example of using Shift cipher (aka Caesar cipher) :frommersad.classical.shift_cipherimportShiftCipher,shift_cipher_translatorMESSAGE="Hail Caesar!"ALPHABET="abcdefghijklmnopqrstuvwxyz"KEY=4CIPHER=shift_cipher_translator(MESSAGE,key=KEY,letter_sequence=ALPHABET)print(CIPHER)# Out: Hemp Ceiwev!# with translator function you need to pass all arguments# in each call again and again.# now the  second way of using shift cipher is using the class instead of function.# create object without any keyword arguments so agent will use# default values for all the settings. defaults are predefined in class.agent=ShiftCipher()# override defaults.agent.config(key=3453,letter_sequence=ALPHABET)# also you can do it at the time yu creat object:# agent = ShiftCipher(key=3453, letter_sequence=ALPHABET)# config usage is to override any existing properties with# new values at any time after creating the object.# encrypt a string.print(agent.encrypt("Hail Julius Caesar."))# Out:  'Hvdg Jpgdpn Cvznvm.'# with this object approach you don't need to pass every thing in each call to# encrypt or decrypt.# another oneprint(agent.encrypt("This method is not secure :0 but it is funny."))# Out: Tcdn hzocjy dn ijo nzxpmz :0 wpo do dn apiit.# for decryption simply call decrypt method on agentprint(agent.decrypt("This method is not secure :0 but it is funny."))# Out: Tcdn hzocjy dn ijo nzxpmz :0 wpo do dn apiit.for more examples look atsnippets.Can I use this package in terminal?Yes! :metal:Each cipher module have a corresponding cli program with name convention of:mclModuleName. For example to run Shift cipher module in terminal just typemclShift.
To learn how to work with cli programs type--helpafter program name
(e.g.mclShift --help).ContributionIf you want to contribute to this project, please readCONTRIBUTING.Code of ConductVisit theCode of Conduct.RoadmapVisit theRoadmapto keep track of which features we are currently
working on and which futures will come at future.LicenseLicensed under theAGPLv3.AttributionBooks:Cracking Codes with PythonandUnderstanding CryptographyCode ideas:PyCryptodomeMersad Logo: Designed withOpenMojiOnline resources:Crypto Corner