Parser.add_argument("-bf", "-blocks-of-five", dest="blocks_of_five", action="store_true") Parser.add_argument("-d", "-decrypt", dest="crypt_mode", action="store_false") Parser.add_argument("-e", "-encrypt", dest="crypt_mode", action="store_true") Parser.add_argument("-pa", "-plainAlphabet", help="set plaintext alphabet", type=str) Parser.add_argument("-ca", "-cipherAlphabet", help="set ciphertext alphabet", type=str) If(len(decrypted_message.replace(" ", "")) % 5 = 0):ĭecrypted_message = decrypted_message + " " # if b_blocks_of_five is true, then there are no spaces in decrypted_message, so if length is % 5 = 0 append space # if b_blocks_of_five is false then take all chars, even spaces # if b_blocks_of_five is true skip spaces in message # if character is not in plaintextalphabet New_char_index = inputAlphabet.index(character) # if the character is in the plaintextalphabet Please enter your text here.' -keep-non-alpĭef mon_Sub(plainAlp, cipherAlp, message, b_blocks_of_five, b_crypt_mode, b_keep_char): Python monoalpha.py -plainAlphabet 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' -cipherAlphabet 'BCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzA' -encrypt -message 'Hello this is a test.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |