ICS4

MW

A description, if you like

   
         
#ICS4U0
#Mark Wspanialy
#2018-10-24
#This program encrypts and decrypts messages to files, and decrypts messages from files.

#For testing
import random
import string

#Standardized Testing
import unittest

class Test(unittest.TestCase):
    def test_encrypt(self):
        self.assertEqual(encrypt('Hello my name is Simon.'), '[:eenm%qm8\%:mt^mCt%n8 ')
    def test_decrypt(self):
        self.assertEqual(decrypt('[:eenm%qm8\%:mt^mCt%n8 '), 'Hello my name is Simon.')
    #Can't test decrypt from file, but it runs off of the decrypt definition, so if decrypt works it will work
    #def test_decrypt_from_file(self):
        #self.assertEqual('[:eenm%qm8\%:mt^mCt%n8 '.decrypt_through_file(), 'Hello my name is Simon.')

#Makes an alphabet to use, both capitals and lower case
alphabet = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 !@#$%^&*()<>?:\{}|,.;'[]/-+"
#Re-aranged the values in different spots

secret_message = b"ZMuQ|0I[L&Gk#KYg*BCrlA7ps-\\Vw+:]'it)ye%8nxOT^{Uz1Eqv./S}5>FDPhmNf?c94doR@X$;32j(a! ,H6J