From 8b7829025ea01f66bf75381e537a0b5240d71435 Mon Sep 17 00:00:00 2001 From: Kaushik Narayan R Date: Sun, 11 Feb 2024 14:01:03 -0700 Subject: [PATCH] 1.2b caesar done --- hw1.2/answer.txt | 8 +++++++- hw1.2/caesar_without_key.py | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 hw1.2/caesar_without_key.py diff --git a/hw1.2/answer.txt b/hw1.2/answer.txt index ddd3718..0e1b896 100644 --- a/hw1.2/answer.txt +++ b/hw1.2/answer.txt @@ -8,4 +8,10 @@ which is not english text, also sha512 sum doesn't match a - julia (the thing has a space at the end lol) -mile Vinay and Joseph Gaussinthough not with the speed and ease of a typewriter keyboard. Rather it was the assimilation of encipherment into the overall communication process. Vernam created what came to be called "on-line encipherment" (because it was done directly on the open telegraph circuit) to distinguish it from the old, separate, off-line encipherment. He freed a fundamental process in cryptography from the shackles of time and error. He eliminated a human beingthe cipher clerkfrom the chain of communication. His great contribution was to bring to cryptography the automation that had benefited mankind so much in so many fields of endeavor. These values were immediately recognized, and Ver-nam's idea quickly kicked up a flurry of activity. He put it down on paper in a sketch dated December 17. A.T. & T. notified the Navy, with which it had worked closely in a communications demonstration the previous year, and on February 18, 1918, Vernam, Parker, Lyman F. Morehouse, equipment \ No newline at end of file +mile Vinay and Joseph Gaussinthough not with the speed and ease of a typewriter keyboard. Rather it was the assimilation of encipherment into the overall communication process. Vernam created what came to be called "on-line encipherment" (because it was done directly on the open telegraph circuit) to distinguish it from the old, separate, off-line encipherment. He freed a fundamental process in cryptography from the shackles of time and error. He eliminated a human beingthe cipher clerkfrom the chain of communication. His great contribution was to bring to cryptography the automation that had benefited mankind so much in so many fields of endeavor. These values were immediately recognized, and Ver-nam's idea quickly kicked up a flurry of activity. He put it down on paper in a sketch dated December 17. A.T. & T. notified the Navy, with which it had worked closely in a communications demonstration the previous year, and on February 18, 1918, Vernam, Parker, Lyman F. Morehouse, equipment + +b - caesar +key shift 3, left shift gives: +EMASWALDSRINGSHIGHLANDSSNOOTIESTASCENDSETTERSFLARESTHINKINGSCARPINGSEDERSSWELLEDMERCILESSOVERSENSITIVEADVENTURERDIVANSYPSILANTISJOCASTAHEADRESTSDISSERTATIONSJOISTSBUSSSERAPUPPETRYSBUNTEDAMPHITHEATRESSTEREOSUNJUSTIFIEDZEPHYRUSSABDICATIONSHUSSERLPALMISTFERALMANNERLEONIDSDILLONSWHEREFORESFERTILIZEDDUCKBILLDUNNESSCORESHAIRCUTBOTTICELLIREPELGLIDESFELICESBRAINSTORMINGSCLEMENCYREDOINGMEDICAIDSBLUNDERBUSS + +b - julia \ No newline at end of file diff --git a/hw1.2/caesar_without_key.py b/hw1.2/caesar_without_key.py new file mode 100644 index 0000000..49ff08f --- /dev/null +++ b/hw1.2/caesar_without_key.py @@ -0,0 +1,21 @@ +with open("3/withoutkey/ciphertext.txt", "r") as caesar_cipher_file: + caesar_cipher_content = caesar_cipher_file.read() + + for key_shift in range(1,27): # both left and right, 13x2=26 + print("key shift", key_shift) + + caesar_plaintext_content_left_shift = "" + caesar_plaintext_content_right_shift = "" + for char in caesar_cipher_content: + caesar_plaintext_content_left_shift += chr( + (ord(char) - ord("A") - key_shift) % 26 + ord("A") + ) + caesar_plaintext_content_right_shift += chr( + (ord(char) - ord("A") + key_shift) % 26 + ord("A") + ) + + print("left shift") + print(caesar_plaintext_content_left_shift) + print() + print("right shift") + print(caesar_plaintext_content_right_shift)