def runTest (self): "Check converting English strings to keys" for key, words in test_data: key=binascii.a2b_hex(b(key)) self.assertEqual(RFC1751.english_to_key(words), key)
def runTest (self): "Check converting keys to English" for key, words in test_data: key=binascii.a2b_hex(b(key)) self.assertEqual(RFC1751.key_to_english(key), words)
def runTest(self): "Check converting English strings to keys" for key, words in test_data: key = binascii.a2b_hex(b(key)) self.assertEqual(RFC1751.english_to_key(words), key)
def runTest(self): "Check converting keys to English" for key, words in test_data: key = binascii.a2b_hex(b(key)) self.assertEqual(RFC1751.key_to_english(key), words)
#!/usr/bin/python3 import sys from Cryptodome.Util import RFC1751 from Cryptodome.Util.Padding import pad data = sys.stdin.buffer.read() data = pad(data,8) english = RFC1751.key_to_english(data) sys.stdout.write(english)
#!/usr/bin/python3 import sys from Cryptodome.Util import RFC1751 from Cryptodome.Util.Padding import unpad english = sys.stdin.buffer.read() english = english.decode() data = RFC1751.english_to_key(english) unpadded = unpad(data, 8) sys.stdout.buffer.write(unpadded)