Вы находитесь на странице: 1из 2

Apte Priya Narayanrao

EE16M044

Project report on
CAD for VLSI
Implementation of RSA algorithm in bluespec
Abstract: Implemented of RSA encryption-decryption in bluespec.

ALGORITHM DESCRIPTION :

RSA:

The RSA cryptosystem is simply modular exponentiation . Given public key(N,E) and private key(N,D),
the encryption operation is performed using the public key E as follows:

C=ME modN

N is the product of two large prime numbers p and q

Where M is the plaintext such that 0<M<N and C is the ciphertext which can be decrypted using the
secret key D as follows:

M=CD mod N

1. its main operation is to compute modular exponentiation by repeated modular multiplications.


However the large bit over 1024-bit modular operation makes the RSA system difficult to
implement.
2. For solving this problem,Montgomery modular reduction algorithm is used for modular
multiplication.It replaces division with series of addition and shifting .

Montgomery multiplier in radix 2:MM(x,y,n); //module mont.bsv


Input: x,y,n // x,y and n are k bit binary numbers
Output : z=x*y*R-1modn //R = 2k
z= 0
for i = 0 to n-1
z= z + x[i]*y
if z is odd then z = z + n
z = z>>1
if z n then z = z n
3. Modular exponentiation is a process in which repeated modular multiplication takes place.
Modular exponentiation: test_rsa.bsv//module to encrypt and decrypt

Input : m,exp,n,rr;//rr is constant rr=R2k mod n precomputed

Output: mexp mod n

r= rc = MM(m, rr);

for i in 1 to k loop

r= MM (r,r);

if exp[i] = 1 then r = MM (r,rc) ; end if;

end loop;

r= MM(r,1);//final result

TEST CASE : public key(E,N) =>(3674911,6012707), private key(D,N) => (422191,6012707),

R = 4937900

Input message : 'hefacd

Output cipher : 'h59dd3f

Conclusion: RSA module is working for any N bit encryption and decryption where N is in power of 2
provided valid keys are given.

Вам также может понравиться