symentric & asymentric

Upload: vk1991

Post on 03-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 symentric & asymentric

    1/15

    Subject:-303.Web Design

    And E-commerce

    Guided by :- Devji Chhanga

  • 7/28/2019 symentric & asymentric

    2/15

    What is an Encryption?

    Encryption is for ensuring data

    confidentiality.

    For ex. One person wants to send his

    message to other, encryption schema isused to prevent other people to read it.

    In this schema the original message is

    called plaintext message and the outputmessage is called Cipher text message,

    which is scrambled message.

  • 7/28/2019 symentric & asymentric

    3/15

    Here, the original message is converted

    in output message using an encryptionprocess.

    The encryption process is controlled by

    an encryption key.

    The encryption key governs how the

    plaintext is converted or transformed

    into cipher text.

    Cricket EtkemgvEncryption

    Encryption key

  • 7/28/2019 symentric & asymentric

    4/15

    There are two types of encryption methods:

    1) Symmetric key encryption.

    2) Asymmetric key encryption.

    They are also called private key encryption andpublic key encryption, respectively.

    In symmetric (private) key encryption, the

    encryption key and the decryption key are thesame.

    In asymmetric (public) key encryption, they are

    different.

  • 7/28/2019 symentric & asymentric

    5/15

    Symmetric key encryption.

    Symmetric key encryption follows two basicprinciples, namely substitution andtransposition.

    1).Substitution Caesar cipher is a good example of the

    substitution technique.

    In this encryption method, each letter of thealphabet is substituted with another letter nthplace(s) further down the alphabet.

    The number n can be regarded as the

    encryption key.

  • 7/28/2019 symentric & asymentric

    6/15

    For example, if we encrypt the plaintext HelloWorld with an encryption key n=3, the cipher

    text becomes Khoor Zruog.

    However, substitution is not a secure techniquebecause the same input will always give the

    same output.

    Hence, by counting how frequently a letterappears, one can guess what the letter is likely

    to be, especially if the message is long.

  • 7/28/2019 symentric & asymentric

    7/15

    A better technique is transposition.

    It rearranges the positions of

    the letters as controlled by a key. Columnar Transposition:

    1) Arrange text horizontally.

    2) Use a key to generatea permutation of the

    columns

    3) Read vertically.

  • 7/28/2019 symentric & asymentric

    8/15

    Public Key Encryption

    Diffie and Hellman proposed an innovativeprotocol to establish a secret key between

    two parties even if they have never met

    before.

    This is the beginning of a new type of

    encryption method called public key

    encryption

    In public key encryption, everyone has a pairof keys called the public key and the private

    key.

  • 7/28/2019 symentric & asymentric

    9/15

    If a public key encryption algorithm iseffective, it is almost impossible to deduce

    the corresponding private key from the

    public key. If someone wants to encrypt a message

    for you, he will use your public key to

    encrypt the message. To decrypt thesecret message, your private key must be

    used.

  • 7/28/2019 symentric & asymentric

    10/15

    Hello World! Jgnnq yqtnfEncryption

    Public key

    Jgnnq yqtnf Decryption Hello World!

    Private key

    Plain text

    Plain textCipher text

    Cipher text

    RSA Encryption Algorithm

  • 7/28/2019 symentric & asymentric

    11/15

    Step 1: Pick two large prime numbers p and q

    Step 2: Multiply p and q together to get n (i.e.n = pq )

    Step 3: Choose d, such that d and w =

    ( p - l)(q - 1) are relatively prime (i.e. they

    have no common factor other than one).

    Note also that d must be smaller than w.

    Step 4: Compute e such that 1 = (d x e) mod

    w (i.e., when (d x e)/w, the remainder is 1.

    Step 5: The public key is

    Step 6: The private key is

  • 7/28/2019 symentric & asymentric

    12/15

    Suppose that there is a message with a

    message code m, then the secret code s isworked out by the following formula:

    s = m( pow e) mod n (i.e., the remainder

    when m ( pow e) is divided by n) Decryption is the reverse process. If the

    recipient receives the secret code s, the

    original message code m can be worked outby the following formula:

    m = s ( pow d) mod n (i.e., the remainder

    when s ( pow d) is divided by n).

  • 7/28/2019 symentric & asymentric

    13/15

    Step 1: Pick two large prime numbers: p = 19

    ,q = 7 (here we simply use two small prime

    numbers to illustrate the basic operation). Step 2: Multiply p by q to get n, so n = pq =

    133.

    Step 3: w =( p - l)(q - 1) = 108, we choosed = 31 because 31 and 108 have no common

    factor.

    Step 4: 1 = 31e mod 108, so e = 7.

    Therefore, the keys are

    (public key) and (private

    key). Next we perform encryption for a

    message code m = 29.

  • 7/28/2019 symentric & asymentric

    14/15

    Step 5: Since s = mod n, if m = 29, s = 15.

    That means, the secret code is s = 15.

    Finally, let us check that the original messagecode can be recovered by means of

    decryption.

    Step 6: m = s ( pow d) mod n (Note that d =31 and n = 133).

    Step 7: m = 15 ( pow 31) mod 133 = 29.

  • 7/28/2019 symentric & asymentric

    15/15

    Any Suggestion????

    Thank You.