Ejemplo n.º 1
0
    def test_password_decryption(self):
        """ Verify that decryption matches a known plaintext string """

        ENCRYPTED_MESSAGE = 'wM9rJnv-b5C5S8hwIm062vCpOkA8DbVJ3VtFVo8pBaDYyQKsSAAepJ6N0PBTMeWHLR2ErY1UUOrpiqMaPzaAbrvvi7592JXftV3ZMU7wow=='
        PLAINTEXT_MESSAGE = 'This is a really cool encrypted message'

        password_decryptor = PasswordDecryptor('test password')
        decrypted_message = password_decryptor.decrypt(ENCRYPTED_MESSAGE)

        self.assertEqual(decrypted_message, PLAINTEXT_MESSAGE)
Ejemplo n.º 2
0
    def test_password_decryption(self):
        """ Verify that decryption matches a known plaintext string """

        ENCRYPTED_MESSAGE = "wM9rJnv-b5C5S8hwIm062vCpOkA8DbVJ3VtFVo8pBaDYyQKsSAAepJ6N0PBTMeWHLR2ErY1UUOrpiqMaPzaAbrvvi7592JXftV3ZMU7wow=="
        PLAINTEXT_MESSAGE = "This is a really cool encrypted message"

        password_decryptor = PasswordDecryptor("test password")
        decrypted_message = password_decryptor.decrypt(ENCRYPTED_MESSAGE)

        self.assertEqual(decrypted_message, PLAINTEXT_MESSAGE)
Ejemplo n.º 3
0
    def test_password_encryption_and_decryption(self):
        """ Verify that encryption with a given password matches decryption with the same password """

        PLAINTEXT_MESSAGE =  'This is a really cool encrypted message'

        password_encryptor = PasswordEncryptor('password')
        encrypted_message = password_encryptor.encrypt(PLAINTEXT_MESSAGE)

        password_decryptor = PasswordDecryptor('password')
        decrypted_message = password_decryptor.decrypt(encrypted_message)

        self.assertEqual(PLAINTEXT_MESSAGE, decrypted_message)
Ejemplo n.º 4
0
    def test_password_encryption_and_decryption(self):
        """ Verify that encryption with a given password matches decryption with the same password """

        PLAINTEXT_MESSAGE = "This is a really cool encrypted message"

        password_encryptor = PasswordEncryptor("password")
        encrypted_message = password_encryptor.encrypt(PLAINTEXT_MESSAGE)

        password_decryptor = PasswordDecryptor("password")
        decrypted_message = password_decryptor.decrypt(encrypted_message)

        self.assertEqual(PLAINTEXT_MESSAGE, decrypted_message)