Cryptography

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Cryptography

Nothing remains secret???

The CIA (Central Intelligence agency) may be spying on your


phone.

Hackers may steal the balance from your bank account.

Hackers can break your home surveillance

Your documents, emails, messages, can be intercepted.

If you say “I don’t care!!!” for security, you may have to pay big

Under such circumstances, encryption becomes your best friend


to Secure your data

Security

Two Types:

1. System security
2. Communication security

System security – safeguarding the system from virus attacks,


malware. Keeping the password protected etc.

Communication Security – Security that is needed when we pass


data/information in the network.

In both scenarios, cryptography is a suitable method to keep the


data secured.

Applications of Cryptography

Nowadays, Browsers use encryption to create secure channels to


web servers.

Messaging and email apps encrypt messages before sending them


to recipients.
Operating systems encrypt files when storing them on disk.

Military defense operations

Online purchases and banking operations

What is cryptography?

Encoding the message so that it is understood only by the


intended recipient

What is steganography?

The art of hiding a text in an image is steganography. It is also a


way of securing our transmission. Eg: In the film Arundhadhi, the
text is hided in the heroine photograph. This is called as
steganography.

Cryptography is one of the most widest used methodology right


from the olden days to have a secure communication.

Historical evidences show that even Julius and Ceaser have used
the cryptographic techniques for the meetings.

Cryptography - Know these terms:

Plain text : The user’s readable message

Cipher text: The encoded message

Deciphered text: The text retrieved from encoded message

Encryption: Plain text to cipher text

Decryption: Cipher text to plain text

Key: The code used for converting plain to cipher text and back
again
Encryption 2 types:

Symmetric Encryption – Same key used for Encryption (locking)


and Decryption (unlocking)

Asymmetric Encryption – 2 keys - One key for locking and other


will be for unlocking.

Math behind the Cryptography

1, Modulo arithmetic – is used for symmetric Encryption

2, Prime number property – is used for asymmetric encryption

Modulo arithmetic – “wrap around” effect.

What is the time in 12 hour format for 13:30 Hrs –1:30 How do
you got it ??? you subtracted 12 from the 24 Hr format. This is
called wrap around.

Generally, Mod is always the remainder…

5 mod 10 is 5

20 mod 10 is 0

13 mod 10 is 3

Lets take the digits

Digits 0 1 2 3 4 5 6 7 8 9
Key= 3 4 5 6 7 8 9 10 1 2
3 mod 10 (wrap
=3 around)
8+3=11
11-
10=1
In the encoded text, any number is encrypted with the plain text
+ key

For Example: A number 1828 is represented as 4151 as


encrypted. This is a simple way. We can choose complicated keys
also.

There are many ways of doing this. This is called as algorithms.


There are some standard algorithms available:

1. DES/AES – facebook, instagram, twitter


2. RSA – used in whatsapp
3. Md5 – gmail – for password storage

Other algorithms

4. Elliptic curve
5. SHA
6. Diffie-Hellman

Demo of CCED algorithm

Simplest version of DES algorithm – used in ATM pin

We can use different keys for each rounds. For example:

Digits 0 1 2 3 4 5 6 7 8 9
Round1 1 2 3 4 5 6 7 8 9 0

Round2 2 3 4 5 6 7 8 9 0 1

Round3 3 4 5 6 7 8 9 10 1 2

Round4 4 5 6 7 8 9 0 1 2 3
For the same number: 1828

Encryption:

1 is at position 0 in round1 - 0

8 is at position 6 in round2 -6

2 is at position 9 in round3 – 9

8 is at position 4 in round4 – 4

So the encrypted number for 1828 is 0694

Decryption

See what is at positions

0 – At position 0 in round1 the number is 1

6 – At position 6 in round2 the number is 8

9- At position 9 in round3 the number is 2

4– At position 4 in round4 the number is 8

So the decrypted number for 0694 is 1828

Prime Numbers:

The prime numbers are used in asymmetric encryption


techniques. Since we need two keys in asymmetric encryption,
we choose 2 prime numbers, because multiplying two prime
numbers will give a composite number. But getting the prime
factors of the composite number and its combination is little
tedious for the hacker to hack. Hence prime numbers are used in
asymmetric encryption to increase the complexity level for a
hacker. RSA and Elliptic curve method uses the prime numbers
for key generation. The prime numbers are generated using x2-
x+41.

Problem to solve

Plain text – 3416

Cipher text – After Encryption – 2282

Decipher text – After Decryption of 2282 is 3416.

You might also like