Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 01_visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
m = np.matrix([
[0,1,1,0]
],dtype=int)
print "Message Text:\t",m
print("Message Text:\t",m)
tPriv = privateKeyH84()
tPub = publicKeyH84(tPriv.makeGPrime())
ct = tPub.encrypt(m)
print "Cipher Text:\t",ct
print("Cipher Text:\t",ct)
mt = tPriv.decrypt(ct)
print "Decoded Text:\t",mt
print("Decoded Text:\t",mt)
4 changes: 2 additions & 2 deletions 02_file_encrypt_decrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

tPriv = privateKeyH84()
tPub = publicKeyH84(tPriv.makeGPrime())
print "Encrypting..."
print("Encrypting...")
tPub.encryptFile("caesar_letter.txt")
print "Decrypting..."
print("Decrypting...")
tPriv.decryptFile("caesar_letter.txt.ctxt")
2 changes: 1 addition & 1 deletion 03_private_key_crack.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
tPriv = privateKeyH84()
tPriv.printCode()
brute = bruteForcerH84(tPriv.makeGPrime())
print "Attempting to Crack..."
print("Attempting to Crack...")
brute.attemptKey()
brute.printCode()
8 changes: 4 additions & 4 deletions 04_file_encrypt_crack_decrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

tPriv = privateKeyH84()
tPub = publicKeyH84(tPriv.makeGPrime())
print "Encrypting..."
print("Encrypting...")
tPub.encryptFile("caesar_letter.txt")
print "Attempting to Crack..."
print("Attempting to Crack...")
brute = bruteForcerH84(tPub.GPrime)
brute.attemptKey()
print "Found key in: " + str(brute.attempts) + " attempts.\n"
print("Found key in: " + str(brute.attempts) + " attempts.\n")
crackedPriv = privateKeyH84(brute.sConsider,brute.pConsider)
print "Decrypting with Cracked Key..."
print("Decrypting with Cracked Key...")
crackedPriv.decryptFile("caesar_letter.txt.ctxt")
2 changes: 1 addition & 1 deletion 05_H16_11_private_key_crack.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
tPriv = privateKeyH1611()
tPriv.printCode()
brute = bruteForcerH1611(tPriv.makeGPrime())
print "Attempting to Crack..."
print("Attempting to Crack...")
brute.attemptKey()
brute.printCode()
Binary file added __pycache__/mc_core.cpython-39.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion caesar_letter.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
“Caesar, beware of Brutus. Take heed of Cassius. Come not near Casca. Have an eye to Cinna. Trust not Trebonius. Mark well Metellus Cimber. Decius Brutus loves thee not. Thou hast wronged Caius Ligarius. There is but one mind in all these men, and it is bent against Caesar. If thou beest not immortal, look about you. Security gives way to conspiracy. The mighty gods defend thee!
     Thy lover,
     Artemidorus”
     Artemidorus”
2 changes: 1 addition & 1 deletion caesar_letter.txt.ctxt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
�,8/dzk�d���)ڼ������TX��mܤ�4��¹�,@],���d�=�4�ռ���p�y���v��*���|�=��򳳨��kX��QX��ռ�, �͹�F�|�����]� ���d�阮�=�1�X�1�m� �*�yڑ����a���@�T�W�|�@ܝ��@]E1C����1m, �p�,�|�E��� ������d=ڌ�p�,1� �WXd�弫�F�y����� �ڵd�/1#�Α|X1|1%�g�d��,E1�J1�v�,�����d1Ց�dXE�,���p�����,��X��Tڅ,�]1>�v1p���X���� T��z1��|�@�8�k�������X�����1���1��)��dXͤ��C���yX�1��|X�ˌT��z1d�,�4,��CX����,�|�=���1T� ��C�����1s�����I�7�/���>�����d��^��� �7�@�m�ˡ=��W�� �[�E����d�˘쀳���y����X� =͑y�|�dzI�,���=s���]1>���d��4�p���=,����b���s��L��ڌX�a�,/�@�g������@1I1�1b�T������v�˼ 4E1���XT���Cȝ���X�[ȹ�p�ǼXڡ��C��=��,@�͹൉����X��I���[,��@4�*���@�F����z��C�@��1³]X��@1�T���4���=�ȝ���T�v�a���� 2� �>8E��>2ǫ�* 8ͫ����4����s����ڵ1�X��%�ˤ*lj,�*古z ͛�z@>Տ�2�*͝)����T�^�ӳ�1�ܤ�d��˨>Qn�
>��@���]Qz�uߨ���pWp]J��]����X� E�]]��Шp*R�%�ڮ/pvp�]��,Eڰ]kW�J%pu�Q]�%]��/�OW��^��v�%�]�E1Q^p]4��*��Q&E�E���� % ���OE��� �aQ��uW� Q�]4�@]X��uz��]����/W�W�EvW�&�J���*^�*�� Qͨ��^���W^]p]�]>�܊z� �>�%;����W|p��]X��� �)]��Q�E�ĺ^��@�/W�]Q�]��p>��Ez�Q��R��p�%��p�z굺R��pQ�]ٺW]J���]kQzuX�uvW����&��%u�W�*p]CE�p�����E�E&]*z����Q�u��X�����E�W�W�*���J*p2�J%Ek���]J���� ���z��E�uQ�E�E�Ev]���E&�u�Ն���Qgu^*ER�W)WJ�vp�pW�>E��@W�*��]�*��EX�4����Q�Q�E��&�/�%��]�Q^�]߮�����Q]���g˨�W�WXW^*�%�]u�*��՞1�;EI������WF���u�u�QIEh�W�E�]˺J��p��E��X�4� z/uz]/�z��Q������@]*W��WQ����������%Չ�Q���&�/��Q���Q��/���2�^�E�ER��yQ�E�Eg�%��� ������@W�RQuREW�� �WgE�EX��1�4pC a�4�a#�pga/>�Cspk#�ڵ������]���u����y �v�#@kOvpCg pkgv��sO4pa# ��*��%E�Qy�E%u�*��*v�gܹ
Expand Down
2 changes: 1 addition & 1 deletion caesar_letter.txt.ctxt.decoded
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
“Caesar, beware of Brutus. Take heed of Cassius. Come not near Casca. Have an eye to Cinna. Trust not Trebonius. Mark well Metellus Cimber. Decius Brutus loves thee not. Thou hast wronged Caius Ligarius. There is but one mind in all these men, and it is bent against Caesar. If thou beest not immortal, look about you. Security gives way to conspiracy. The mighty gods defend thee!
     Thy lover,
     Artemidorus”
     Artemidorus”
Loading