Exemplo n.º 1
0
    def test_unicodePassphrase(self):
        unicodePassphrase = u"łśźćżów~!@#$ '\"%^&*("
        ck = CryptoKey()
        msg = ck.encrypt(self.testMessage)
        key = ck.export(unicodePassphrase)

        ck2 = CryptoKey(key, unicodePassphrase)
        msg2 = ck2.encrypt(self.testMessage)
        self.assertEqual(ck.decrypt(msg), ck2.decrypt(msg2))
Exemplo n.º 2
0
    def test_unicodePassphrase(self):
        unicodePassphrase = "łśźćżów~!@#$ '\"%^&*("
        ck = CryptoKey()
        msg = ck.encrypt(self.testMessage)
        key = ck.export(unicodePassphrase)

        ck2 = CryptoKey(key, unicodePassphrase)
        msg2 = ck2.encrypt(self.testMessage)
        self.assertEqual(ck.decrypt(msg), ck2.decrypt(msg2))
Exemplo n.º 3
0
    def test_changeKeyPassphrase(self):
        ck1 = CryptoKey(passphrase="pass")
        encryptedMessage = ck1.encrypt(self.testMessage)
        key = ck1.export("otherPass")

        ck2 = CryptoKey(key, "otherPass")
        self.assertEqual(self.testMessage, ck2.decrypt(encryptedMessage))
Exemplo n.º 4
0
    def test_changeKeyPassphrase(self):
        ck1 = CryptoKey(passphrase="pass")
        encryptedMessage = ck1.encrypt(self.testMessage)
        key = ck1.export("otherPass")

        ck2 = CryptoKey(key, "otherPass")
        self.assertEqual(self.testMessage, ck2.decrypt(encryptedMessage))
Exemplo n.º 5
0
 def test_message(self):
     ck = CryptoKey()
     encryptedMsg = ck.encrypt(self.testMessage)
     self.assertEqual(ck.decrypt(encryptedMsg), self.testMessage)
Exemplo n.º 6
0
 def test_unicode(self):
     unicodeMessage = "łśźćżów~!@#$ '\"%^&*("
     ck = CryptoKey()
     encryptedMsg = ck.encrypt(unicodeMessage)
     self.assertEqual(ck.decrypt(encryptedMsg), unicodeMessage)
Exemplo n.º 7
0
 def test_message(self):
     ck = CryptoKey()
     encryptedMsg = ck.encrypt(self.testMessage)
     self.assertEqual(ck.decrypt(encryptedMsg), self.testMessage)
Exemplo n.º 8
0
 def test_unicode(self):
     unicodeMessage = u"łśźćżów~!@#$ '\"%^&*("
     ck = CryptoKey()
     encryptedMsg = ck.encrypt(unicodeMessage)
     self.assertEqual(ck.decrypt(encryptedMsg), unicodeMessage)