Module 5 Cryptography
Module 5 Cryptography
Module 5 Cryptography
COMMUNICATION SECURITY
Activity
a.
b.
c.
d.
e.
________________________________________________________________
________________________________________________________________
________________________________________________________________
Introduction
Social media applications are a trend to a lot of people. We are able to reach and
communicate with people no matter where they are. However, we use these
applications without knowing if these applications are secure enough to call it a “private”
conversation.
There are three notions of security which we need to understand before we go deeper
in this topic. These are:
a. Perfect security - the scheme is said to have perfect security or to have
information theoretic security, if an adversary with infinite computing power can
learn nothing about the plaintext given the ciphertext.
b. Semantic security - This is similar to perfect security but we only allow an
adversary with polynomially bounded computer power
c. Polynomial security - this is sometimes called indistinguishability of encryptions, it
is said to be so because if no adversary can win the following game with
probability greater than one half.
Double Encryption
To encipher a message the sending operator decided on a message key. The message
key would be a sequence of three letters, say D H I. The message key needs to be
transported to the recipient. Using the day key, the message would be enciphered
twice. The double enciphering is to act as a form of error control. Hence, D H I might be
enciphered as X H J K L M. Note, that D encrypts to X and then K, this is a property of
the Enigma Machine.
PRINCIPLES OF CRYPTOGRAPHY
Activity
- KZFO SZONLH
Message:
Cryptography is the science of using mathematics to encrypt and decrypt data.
intended recipient.
Cryptography can be strong or weak. Its strength is measured in the time and
resources it would require to recover the plaintext. The result of strong cryptography is
decoding tool.
and decryption process. It works in combination with a key – a word, number, or phrase
– to encrypt the plaintext. The security of encrypted data is entirely dependent on two
things: strength of the cryptographic algorithm and the secrecy of the key.
A cryptographic algorithm, and all possible keys and all the protocols that make it work
comprise a cryptosystem.
involves only one key that is used for encryption and decryption.
Conventional cryptography
Public key cryptography solves the problem of key distribution. This is an asymmetric
scheme that uses a pair of keys for encryption: a public key which encrypts data and a
The concept was introduced by Whitfield Diffie and Martin Hellman in 1975.
Plaintext
Ciphertext
Plaintext
Pretty Good Privacy (PGP) combines some of the best features of both conventional
When a user encrypts plaintext with PGP, PGP first compresses the plaintext. Data
compression saves modem transmission time and disk space and, more importantly,
resistance to cryptanalysis.
PGP then creates a session key, which is a one-time-only secret key. This key is
a random number generated from the random movements of your mouse and the
keystrokes you type. This session key works with a very secure, fast conventional
encryption algorithm to encrypt the plaintext; the result is ciphertext. Once the data is
encrypted, the session key is then encrypted to the recipient’s public key. This public
key-encrypted session key is transmitted along with the ciphertext to the recipient.
PGP Encryption
Ciphertext +
encrypted session
Session key is key
encrypted with
Plaintext is public key
encrypted with
session key
Decryption works in reverse. The recipients’ copy of PGP uses his or her private key to
recover the temporary session key, which PGP then uses to decrypt the conventionally-
encrypted ciphertext.
PGP Decryption
Encrypted session
key
recipients private
key session key used to original
Encrypted Message
used to decrypt cipher text plaintext
decrypt session key
Ciphertext
encryption is about 1,000 times faster than public key encryption. Public key encryption
in turn provides a solution to key distribution and data transmission issues. Used
together, performance and key distribution are improved without any sacrifice in
security.
ciphertext. Keys are basically really, really, really big numbers. Key size is measured in
bits. In public key cryptography, the bigger the key, the more secure the ciphertext.
However, public key size and conventional cryptography’s secret key size are
totally unrelated. A conventional 80-bit key has the equivalent strength of a 1024-bit
public key. A conventional 128-bit key is equivalent to a 3000-bit public key. Again, the
bigger the key, the more secure, but the algorithms used for each type of cryptography
Caesar’s Cipher
Example: If the word “SECRET” will be encoded using Caesar’s key value of 3, the
alphabet will be offset so that the 3rd letter down (D) begins the alphabet.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
DEFGHIJKLMNOPQRSTUVWXYZABC
To allow someone else to read the ciphertext, tell them that the key is 3.
Affine Ciphers
Affine cipher uses a encrypting function with additions and multiplication which
convert a letter of value x in a 26 letters alphabet into another letter with value of (ax+b)
modulo 26.
Encryption uses a classic alphabet and two integers called coefficients or keys A
and B.
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1 2 3 4 5 6 7 8 9 10 1 12 13 14 1 16 17 1 19 20 21 2 23 24 25 26
1 5 8 2
Francis Bacon Cipher
Francis Bacon created one of the more interesting substitution ciphers. He used
two different type faces slightly differing in weight (boldness). He broke up his ciphertext
into 5 - character groups, each of which would represent one character in his plaintext.
Depending on which characters of the group were bold, one could determine the
plaintext character using the following table (* stands for a plain character and B for a
bold character)
The same secret message as above would appear as (Bacon's bold and plain
characters were less obvious than those below):
M E E T M E B E
H I N D T H E G
Y M A F T E R S
C H O O L
Columnar Transposition
First, think of a secret key word. Ours will be the word SECRET. Next, write it above the
columns of letters in the square, and number the letters of the key word as they would
fall if we placed them in alphabetical order. (If there are duplicate letters, like the "E",
they are numbered from left to right.)
5 2 1 4 3 6
S E C R E T
M E E T M E
A F T E R S
C H O O L B
E H I N D T
H E G Y M O
Now write the columns down in the order indicated by the numbers. The resulting
ciphertext looking like this:
Polybius Square
Example:
32 15 44 23 34 14 24 33 44 23 15 32 11
14 33 15 43 43
Decryption:
32 15 44 23 34 14 24 33 44 23 15 32 11
M E T H O D I/J N T H E M A
14 33 15 43 43
D N E S S
You can construct a secret message from the above table. Every time you see an "I"
you would substitute the "O" beneath and so on for the other characters. The message
"Meet me after school behind the gym," would read
Word lengths - especially the short words - give great clues as to the nature of the code
(see frequency charts). To help conceal your message, ignore the spaces and break the
message up into equal-sized chunks. Five letters are customary in the spy biz, so your
message comes out like this (Note that an extra "dummy" character "M" is added at the
end to make it come out with a 5-letter group. Your recipient should have no trouble with
the extra character.
Try this!
- Galileo Galilei