CRYPTOGRAPHY
CRYPTOGRAPHY
Cryptography
This page ‘jumbles’ text, keeping the first and last letter of each word and
randomly scrambling everything in between. Surprisingly, it’s still pretty
readable.
1.2.2 Acquire New Knowledge
1.2.2.1 Definition of Terms
Cryptography is the science of using mathematics to encrypt and decrypt data.
Cryptography enables you to store sensitive information or transmit it across
insecure networks so that it cannot be read by anyone except the intended
recipient.
Plaintext - is the original message or original data that needs to be encrypted. In
simple terms, and original message that needs to be encrypted is known as
plain text.
Ciphertext - is the encrypted message or output message which is produced as
output. It mainly depends on plaintext and secret key.
Encryption Algorithm - is an algorithm which transforms and substitutes the
plaintext in to Ciphertext.
Decryption - is the process of converting from ciphertext to plain text is called as
decryption or deciphering.
Cryptanalysis - is a technique which used to decipher a ciphertext without
knowledge of encryption details. “Breaking of Code”
Cryptology - Cryptography and cryptanalysis have together known as
cryptology.
1.2.2.2 Basic Cryptography
I. Substitution Cipher - each letter is replaced with a letter some fixed
number of positions in the alphabet
A. Shifted Alphabet Code / Ceasar Cipher - each letter is replaced with a letter
some fixed number of positions in the alphabet
Example 1: Use the Caesar cipher with shift of 3 to encrypt the message: DURA
LEX SED LEX.
Mapping:
Image Credit:https://en.wikipedia.org/wiki/Caesar_cipher
A B C D E F G H I J K L M N O P Q R S T U V WX Y Z
X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
Example 3: Use the Caesar cipher with shift of 15 to encrypt the message:
PERICARDITIS.
Original Message: PERICARDITIS
Encrypted Message: ETGX RPGS XIXH
Example 4: Decrypt the message below if it was encrypted using a shift cipher
with shift 20.
Encrypted Message: QIL EMG ULN HIN QIL EBU LXU
Original Message: WOR KSM ART NOT WOR KHA RDA
Original Message: WORK SMART NOT WORK HARD
Alberti cipher disk (1400s)
In a cipher disk, the inner wheel could be turned to
change the cipher shift. The larger one is called Stabilis
(stationary or fixed), the smaller one is called Mobilis
(movable).
Encryption Security
• The security of a cryptographic method is very important to the person
relying on their message being kept secret. The security depends on two
factors:
a. the security of the method being used
b. the security of the encryption key used
• In the case of a shift cipher, the method is “a shift cipher is used”. The
encryption key is the “specific amount of shift” used.
• The security of any encryption method should depend only on the
encryption key being difficult to discover. It is not safe to rely on the
encryption method (algorithm) being kept secret.
• The alphabetical shift cipher has 25 encryption keys.
• The alphanumeric shift cipher has 35 encryption keys.
Example 5: Using alphanumeric shift cipher
Note: If alphabetical or alphanumeric is not stated in the problem, always used
alphabetical.
What is the obscured message from the cipher text: PECTORAL MUSCLES
using alphanumerical shift cipher with shift 8?
Original Message: PECTORAL MUSCLES
Encrypted Message: XMK1WZIT U20KTM0
Brute Force Attack – a method for breaking encryption by trying all encryption
keys.
Example 6: Suppose you intercept a message, and you know the sender is using
a Caesar cipher, but do not know the shift being used. The message begins
EQZP. What is the message?
II. Transposition Cipher -the letters are rearranged according to some
predetermined rule or key.
Example 1: Encryption
Encrypt the message:MEET ME AT THE SECRET LOCATION using rows of 8
characters each.
Step 1. Write the message in rows of 8 characters each. Nonsense characters
are added to the end to complete the last row.
M E E T M E A T
T H E S E C R E
T L O C A T I O
N X X X X X X X
Step 2. Encrypt the message by recording down the columns. For example, the
first column reading down would be MTTN.
MTTN EHLX EEOX TSCX MEAX ECTX ARIX TEOX
Note: The spaces will be removed or repositioned to hide the size of the table used
since it is the encryption key used to hide the message.
C O M M
A N D L
I N E I
N T E R
F A C E
H E A R T
3 2 1 4 5
H I G H B
L O O D P
R E S S U
R E X X X
H E A L T H
3 2 1 5 6 4
Step 3. Write down the message down the columns using the order of letters in
the keyword.
a.
H E A L T H
3 2 1 5 6 4
X
b. Fill out column 2.
H E A L T H
3 2 1 5 6 4
R T
L H
T E
N X
H E A L T H
3 2 1 5 6 4
A R T E R I
A L H Y P E
R T E N S I
O N X X X X
Step 4. To decrypt the message, read across the rows. Remove the non-
significant characters.
Original Message: ARTERIAL HYPERTENSION
2.2.3. Analysis /Enhancement Activity
Practice: Try to answer the following to improve your skills:
A. Encrypting a message using Shifted Alphabet/Ceasar’s Cipher
1. Frequent Flyer – shifting 5 Ans. K******y K***w
2. Patient is High Risk – shifting 15 Ans. E*****i *h W**w G**z
B. Decrypting a message using Shifted Alphabet/Ceasar’s Cipher
Nursing Jargons
1. Mszzck Gipaofwbs – Shift 12 encryption Ans. *****w ********e
2. Mvek Aftbvp – Shift 9 encryption Ans. **** *****y
3. Wjtamdziy – Use brute force attack since we don’t know the number of
shifting used in encrypting the message. Ans. *********
2.2.4 Application
What is the announcement?
Everytime that there is an emergency situation, the announcement in
the bulletin board is encrypted to prevent the general public in the hospital from
reading it for security purposes.
The hospital you are working for uses transposition cipher using the
letters of the DAY as KEY encryption word. Suppose today is MONDAY, what is
the message written in the bulletin board?
Announcement:
RNBAR RXPEL REOXT SWOET OEDLE HMXHI IPDOW ETETE RX
Clue: Keyword: M O N D A Y
Number of Characters: 42 / 6 = 7
M O N D A Y
1
R
N
B
A
R
R
X