Package: ucyph
ucyphEncrypt and Decrypt text files from the command line using historical ciphers.InstallationpipinstallucyphUsageAll commands will require ausage codeand atext fileto encrypt/decrypt.
Theusage codeis a number that corresponds to a cipher(usage codes can be found here).
Thetext fileis the file that will be encrypted/decrypted.In addition to encrypting files, you can also use the application ininteractive mode. To activate interactive mode, simply run the commanducyphwithout any arguments or with the-iflag. You will be prompted to enter ausage code,text file, andkey(if applicable).
Interactive mode allows users to encrypt/decrypt text in the command line without having to use files.Examples:Interactive Modeucyph-iEncrypting/Decrypting FilesThis command calls theVigenerecipher with akeyof 'password', and encrypts the text fromhello.txtin place as an output file is not specified.ucyph5hello.txt-k'password'To decrypt the text, simply add-dflag to the end of the command:ucyph5hello.txt-k'password'-dThis command calls thePlayfaircipher with akeyof 'password', and writes the encrypted text fromhello.txtintooutput.txt.ucyph11hello.txt-ooutput.txt-kpasswordNow, to decrypt the text fromoutput.txt, simply add-dflag to the end of the command(note that an output file is not specified):ucyph11output.txt-kpassword-dUsage CodesCipherUsage CodeRequires KeyCaesar3NoVigenere5YesPlayfair11YesRot-1313NoRot-4747NoCipher Descriptions:Caesar Cipher"One of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence." -Wikipedia article on Caesar CipherVigenere Cipher"A method of encrypting alphabetic text where each letter of the plaintext is encoded with a different Caesar cipher, whose increment is determined by the corresponding letter of another text, the key.For example, if the plaintext isattacking tonightand the key isOCULORHINOLARINGOLOGY, thenthe first letter a of the plaintext is shifted by 14 positions in the alphabet (because the first letter O of the key is the 14th letter of the alphabet, counting from 0), yielding o;the second letter t is shifted by 2 (because the second letter C of the key means 2) yielding v;the third letter t is shifted by 20 (U) yielding n, with wrap-around;
and so on; yielding the messageovnlqbpvt eoeqtnh. If the recipient of the message knows the key, they can recover the plaintext by reversing this process." -Wikipedia article on Vigenere CipherPlayfair Cipher" a manual symmetric encryption technique and was the first literal digram substitution cipher. The scheme was invented in 1854 by Charles Wheatstone, but bears the name of Lord Playfair for promoting its use.The technique encrypts pairs of letters (bigrams or digrams), instead of single letters as in the simple substitution cipher and rather more complex Vigenère cipher systems then in use. The Playfair is thus significantly harder to break since the frequency analysis used for simple substitution ciphers does not work with it." -Wikipedia article on Playfair CipherRot-13 Cipher"ROT13 ("rotate by 13 places") is a simple letter substitution cipher that replaces a letter with the 13th letter after it, in the alphabet. ROT13 is a special case of the Caesar cipher which was developed in ancient Rome." -Wikipedia article on Rot-13 CipherRot-47 Cipher"ROT47 is a derivative of ROT13 which, in addition to scrambling the basic letters, also treats numbers and common symbols. The transformation is done by the same algorithm as for ROT13, except that characters are rotated by 47 places, rather than 13." -Wikipedia article on Rot-47 Cipher