170 likes | 334 Views
Zac Blohm & Kenny Holtz. Cryptography. Importance of Algorithms. Algorithms are the basis for cryptography. The basic idea of Cryptography in Computer Science is to run a message through an algorithm to receive an encrypted text which can safely be sent to be decrypted with another algorithm.
E N D
Zac Blohm & Kenny Holtz Cryptography
Importance of Algorithms Algorithms are the basis for cryptography • The basic idea of Cryptography in Computer Science is to run a message through an algorithm to receive an encrypted text which can safely be sent to be decrypted with another algorithm
Classical Cryptography • Monoalphabetic • Caesar Cypher • Polyalphabetic • Transpositional • Compositional
Monoalphabetic Cyphers • Simple substitutions • One of the earliest used forms of cryptography • Easily cracked by statistical analysis (ex. how many times each character occurs) and trial and error • Most famous example is the Caesar Cypher which simply replaces each character with one “K” places further in the alphabet
Example of a Caesar Cypher • If K=3, then A becomes C, B becomes D etc… • Therefore the plaintext “This is a message” • Is encrypted to say “Vjkuku c oguucig” • Notice that the number of characters and any patterns between them are shared (repeated characters, the standalone vowel etc…)
Polyalphabetic Cyphers • Multiple alphabets to disguise patterns • Biggest difference between them is how many alphabets and what determines a change of alphabet
Plaintext vs cyphertext for previous key Plaintext cyphertext Pjtobtoblwopoulcg The key changed alphabets after each character (spaces were incorporated into each alphabet to conceal word length) • This is a message
Failings of polyalphabetic cyphers • Still direct substitutions • The change of alphabets can be recognized, which then reduces the problem to a series of monoalphabetic problems
Transpositional Cyphers • Changes the arrangement of the plaintext to disguise the message • Immune to the frequency analysis that defeats substitution cyphers • Pure transpositional cyphers produce same amount of each letter as present in plaintext • A common example involves reading into a matrix one way, and reading out the other
Transpositional plaintext vs cyphertext plaintext cyphertext Ti satsesghsietmsae # of t’s: 3 # of h’s: 1 # of i’s: 2 # of s’s: 5 # of spaces: 4 # of a’s: 2 # of e’s: 3 # of m’s: 1 # of g’s: 1 • This is a test message • # of t’s: 3 • # of h’s: 1 • # of i’s: 2 • # of s’s: 5 • # of spaces: 4 • # of a’s: 2 • # of e’s: 3 • # of m’s: 1 • # of g’s: 1
Failings of transpositional cyphers • The matrix example never changes the letter in the first position or the last, and requires the key to contain the size of the matrix needed for decryption • Creates an anagram (meaning some messages are easily decrypted just by rearranging the letters to make the most probable words, longer messages make this harder)
Compositions of substitution and transposition • Combining both makes a much stronger cypher as you can eliminate most of the apparent patterns in your cyphertext • An example would be taking “this is a test message” through the previously used polyalphabetic cypher to get “pjtobtoblwvpovkigcocra” and then reading it through a 2x11 matrix as before
Compositional plaintext vs cyphertext plaintext cyphertext “ptbolvokgorjotbwpvicca” No direct correlation between the position or frequency of each character • “This is a test message”