예제 #1
0
    def test_encrypt_decrypt_sentence_with_punctuation(self):
        self.plaintext = cipher.PlaintextMessage('Cat, dog@,  .', 19)
        encrypted_text = self.plaintext.get_message_text_encrypted()

        self.ciphertext = cipher.CiphertextMessage(encrypted_text)
        self.assertEqual(self.ciphertext.decrypt_message(),
                         (7, 'Cat, dog@,  .'))
예제 #2
0
 def test_encrypt_msg_with_number(self):
     self.plaintext = cipher.PlaintextMessage('5 carpet', 19)
     self.assertEqual(self.plaintext.get_message_text_encrypted(),
                      '5 vtkixm')
예제 #3
0
 def test_encrypt_msg_with_capital_letters(self):
     self.plaintext = cipher.PlaintextMessage('BluEbErRy', 25)
     self.assertEqual(self.plaintext.get_message_text_encrypted(),
                      'AktDaDqQx')
예제 #4
0
 def test_encrypt_msg_shift_25(self):
     self.plaintext = cipher.PlaintextMessage('blueberry', 25)
     self.assertEqual(self.plaintext.get_message_text_encrypted(),
                      'aktdadqqx')
예제 #5
0
 def test_encrypt_msg_shift_23(self):
     self.plaintext = cipher.PlaintextMessage('juice', 23)
     self.assertEqual(self.plaintext.get_message_text_encrypted(), 'grfzb')
예제 #6
0
 def test_encrypt_msg_shift_21(self):
     self.plaintext = cipher.PlaintextMessage('duvet', 21)
     self.assertEqual(self.plaintext.get_message_text_encrypted(), 'ypqzo')
예제 #7
0
 def test_encrypt_msg_shift_19(self):
     self.plaintext = cipher.PlaintextMessage('carpet', 19)
     self.assertEqual(self.plaintext.get_message_text_encrypted(), 'vtkixm')
예제 #8
0
 def test_encrypt_msg_shift_17(self):
     self.plaintext = cipher.PlaintextMessage('baguette', 17)
     self.assertEqual(self.plaintext.get_message_text_encrypted(),
                      'srxlvkkv')
예제 #9
0
 def test_encrypt_msg_shift_15(self):
     self.plaintext = cipher.PlaintextMessage('rope', 15)
     self.assertEqual(self.plaintext.get_message_text_encrypted(), 'gdet')
예제 #10
0
 def test_encrypt_msg_shift_13(self):
     self.plaintext = cipher.PlaintextMessage('shirt', 13)
     self.assertEqual(self.plaintext.get_message_text_encrypted(), 'fuveg')
예제 #11
0
 def test_encrypt_msg_shift_11(self):
     self.plaintext = cipher.PlaintextMessage('wardrobe', 11)
     self.assertEqual(self.plaintext.get_message_text_encrypted(),
                      'hlcoczmp')
예제 #12
0
 def test_encrypt_msg_shift_9(self):
     self.plaintext = cipher.PlaintextMessage('rose', 9)
     self.assertEqual(self.plaintext.get_message_text_encrypted(), 'axbn')
예제 #13
0
 def test_encrypt_msg_shift_7(self):
     self.plaintext = cipher.PlaintextMessage('worm', 7)
     self.assertEqual(self.plaintext.get_message_text_encrypted(), 'dvyt')
예제 #14
0
 def test_encrypt_msg_shift_5(self):
     self.plaintext = cipher.PlaintextMessage('apple', 5)
     self.assertEqual(self.plaintext.get_message_text_encrypted(), 'fuuqj')
예제 #15
0
 def test_encrypt_msg_shift_3(self):
     self.plaintext = cipher.PlaintextMessage('cat', 3)
     self.assertEqual(self.plaintext.get_message_text_encrypted(), 'fdw')
예제 #16
0
 def test_encrypt_msg_shift_1(self):
     self.plaintext = cipher.PlaintextMessage('earth', 1)
     self.assertEqual(self.plaintext.get_message_text_encrypted(), 'fbsui')