Cipher Decryptions and Secret Messages Projects in Python:
Links to Caesar Cipher Encryption and Decryption Code and Secret Messages,
along with Code to detect specific strings in other
strings using only indexing, slicing, concatenation with a
recursive function and no loops, and also, code to
emulate and old fashioned type writer, Exercises
in Python
Caesar Cipher Encryption and Decryption
Pythod Code:
- Encryption is the process of obscuring
information to make it unreadable without special
knowledge.
- Encryption lets you share information with
other trusted people, without fear of disclosure.
- A cipher is an algorithm for performing
encryption.
- The original information is called plaintext.
- After encryption, it is called ciphertext.
- A cipher depends on a piece of information called a
key.
- The same plaintext encrypted with 2 different keys
should have 2 different ciphertexts.
- Without the key, it should be difficult to
decrypt the resulting ciphertext into readable
plaintext.
- Caesar Cipher's basic idea is to choose an integer key,
shift every letter of your message by the integer key.
"h" becomes "j" for integer 2, "e" becomes "g", etc,
shifting the letter 2 spots to the right.
- For this cipher's simplicity, punctuation and other
such letters and numbers were ignored, and upper case
was mapped to upper case, lower case to lower
case.
- We then took someone else's encrypted text, and had to
find the shift key that would decrypt the text, by
finding if all words were valid from the shift key
chosen.
String
reversal using only string operations: indexing,
slicing, concatenation with a recursive function, not
using any loops:
- Next, we were asked to do string reversal using only
string operations: indexing, slicing, concatenation with
a recursive function, not using any loops.
- Next we had to write an Erician function, meaning if a
word contained the letters "eric" in that order, but
there could be other letters in between, as long as in
that order.
Emulating an old
fashioned type writer, in that when ever it is in the
middle of a word, and reaches the desired line length,
the internal bell rings, signifying to the typist that
after finishing the current word, a newline must be
inserted manually:
- The last part of this assignment was to emulate an old
fashioned type writer, in that when ever it is in the
middle of a word, and reaches the desired line length,
the internal bell rings, signifying to the typist that
after finishing the current word, a newline must be
inserted manually.
- This process was emulated such that a newline was
inserted as required after each word that exceeded the
desired line length, and this newline insert function
had to be recursive.