image encryption and decryption using rsa algorithm in matlab
#1

image encryption and decryption using rsa algorithm in matlab
Reply
#2

RSA

The RSA cryptosystem is a public-key cryptosystem that offers both encryption and digital signatures (authentication). Ronald Rivest, Adi Shamir, and Leonard Adleman developed the RSA system in 1977 .RSA stands for the first letter in each of its inventors' last names.

The RSA algorithm works as follows: take two large primes, p and q, and compute their product n = pq; n is called the modulus. Choose a number, e, less than n and relatively prime to (p-1)(q-1), which means e and (p-1)(q-1) have no common factors except 1. Find another number d such that (ed - 1) is divisible by (p-1)(q-1). The values e and d are called the public and private exponents, respectively. The public key is the pair (n, e); the private key is (n, d). The factors p and q may be destroyed or kept with the private key.

It is currently difficult to obtain the private key d from the public key (n, e). However if one could factor n into p and q, then one could obtain the private key d. Thus the security of the RSA system is based on the assumption that factoring is difficult

Here is how the RSA system can be used for encryption and digital signatures [ ]

ENCRYPTION

Suppose Alice wants to send a message m to Bob. Alice creates the ciphertext c by exponentiating: c = me mod n, where e and n are Bob's public key. She sends c to Bob. To decrypt, Bob also exponentiates: m = cd mod n; the relationship between e and d ensures that Bob correctly recovers m. Since only Bob knows d, only Bob can decrypt this message.

DIGITAL SIGNATURE

Suppose Alice wants to send a message m to Bob in such a way that Bob is assured the message is both authentic, has not been tampered with, and from Alice. Alice creates a digital signature s by exponentiating: s = md mod n, where d and n are Alice's private key. She sends m and s to Bob. To verify the signature, Bob exponentiates and checks that the message m is recovered: m = se mod n, where e and n are Alice's public key.

Thus encryption and authentication take place without any sharing of private keys: each person uses only another's public key or their own private key. Anyone can send an encrypted message or verify a signed message, but only someone in possession of the correct private key can decrypt or sign a message.

RSA ALGORITHM

The RSA algorithm involves three steps: key generation, encryption and decryption.

Key generation

RSA involves a public key and a private key. The public key can be known by everyone and is used for encrypting messages. Messages encrypted with the public key can only be decrypted in a reasonable amount of time using the private key. The keys for the RSA algorithm are generated the following way:

Choose two distinct prime numbersp and q.
- For security purposes, the integersp and q should be chosen at random, and should be of similar bit-length. Prime integers can be efficiently found using a primality test.Compute n = pq.
- n is used as the modulus for both the public and private keys. Its length, usually expressed in bits, is the key length.Compute φ(n) = φ(p)φ(q) = (p − 1)(q − 1) = n - (p + q -1), where φ is Euler's totient function.Choose an integer e such that 1 <e<φ(n) and gcd(e, φ(n)) = 1; i.e., e and φ(n) are coprime.
- e is released as the public key exponent.
- e having a short bit-length and small Hamming weight results in more efficient encryption – most commonly 216 + 1 = 65,537. However, much smaller values of e (such as 3) have been shown to be less secure in some settings.
Determine d as d ≡ e−1 (mod φ(n)); i.e., d is the multiplicative inverse of e (modulo φ(n)).This is more clearly stated as: solve for d given d⋅e ≡ 1 (mod φ(n))This is often computed using the extended Euclidean algorithm. Using the pseudocode in the Modular integers section, inputs a and n correspond to e and φ(n), respectively.d is kept as the private key exponent.
The public key consists of the modulus n and the public (or encryption) exponent e. The private key consists of the modulus n and the private (or decryption) exponent d, which must be kept secret. p, q, and φ(n) must also be kept secret because they can be used to calculate d.

Encryption

Alice transmits her public key (n, e) to Bob and keeps the private key secret. Bob then wishes to send message M to Alice.

He first turns M into an integer m, such that 0 ≤ m < n by using an agreed-upon reversible protocol known as a padding scheme. He then computes the ciphertextc corresponding to



rsa-algorithm-formula-1


This can be done quickly using the method of exponentiation by squaring. Bob then transmits c to Alice.

Note that at least nine values of m will yield a ciphertextc equal to m, but this is very unlikely to occur in practice.

Decryption

Alice can recover m from c by using her private key exponent d via computing



rsa-algorithm-formula-2


Given m, she can recover the original message M by reversing the padding scheme.

RSA algorithm example

Choose p=3 and q=11Compute n = p * q = 3 * 11 = 33Compute φ(n)= (p – 1) * (q – 1) = 2 * 10 = 20Choose e such that 1 < e < φ(n) and e and n are coprime. Let e=7Compute a value for d such that (d * e) % φ(n)=1. One solutions is d = 3 [3(3 * 7) %20=1]Public key is (e,n) => (7,33)Private key is (d,n) => (3,33)The encryption of m = 2 is c = 27 % 33 = 29The decryption of c = 29 id m =293 % 33 = 2
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: algorithm for encryption decryption for rf projects, wireless data transfer using rsa data encryption algorithm project, aes encryption and decryption coding in matlab, matlab code for encryption algorithm, s des encryption and decryption algorithm code in c, encryption and decryption for digital image matlab source code, voice encryption and decryption matlab code,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  authentication schemes for session passwords using color and images project source code 2 2,251 03-02-2018, 09:35 AM
Last Post: Nischithnash
  source code for rsa encryption and decryption in java 2 8,170 29-05-2017, 04:21 PM
Last Post: Meghna Jadhav
  image encryption and decryption using rsa algorithm in matlab 2 8,062 29-05-2017, 04:17 PM
Last Post: Priyanka Bidikar
  download liver tumor ct scan image in matlab with source code 4 8,215 21-05-2017, 09:54 PM
Last Post: abdulrahmanmashaal
Thumbs Up online catering management system on php with report and source code and ppt 4 8,969 29-04-2017, 10:59 AM
Last Post: jaseela123d
  MATLAB codes needed for powerline communication 1 8,226 12-04-2017, 05:00 PM
Last Post: jaseela123d
  source code for task scheduling using genetic algorithm using java 2 8,679 11-04-2017, 08:31 PM
Last Post: Guest
Thumbs Up source code of online payment system using steganography and visual cryptography 3 8,658 06-04-2017, 09:56 AM
Last Post: jaseela123d
  vhdl code for radix 2 modified booth algorithm 4 1,032 04-04-2017, 10:24 AM
Last Post: Garlapati nikitha
  matlab code for wavelet based ofdm transmitter 1 937 24-02-2017, 11:18 AM
Last Post: ijasti

Forum Jump: