<< NARVAL_S_RSAEncryption NARVAL NARVAL_T_BarabasiAlbert >>

NARVAL >> NARVAL > NARVAL_S_RSAe

NARVAL_S_RSAe

Perform the public and private keys of the RSA algorithm (additional input e).

Calling Sequence

[n,d] = NARVAL_S_RSA(p,q,e)

Parameters

p :

prime number.

q :

prime number.

e :

public exponent.

n :

modulus.

d :

private exponent.

Description

NARVAL_S_RSAe performs the public and private keys of the RSA algorithm (WIKIPEDIA). RSA involves a public key and a private key. The public key can be known by everyone and it is used for encrypting messages. Messages encrypted with the public key can only be decrypted using the private key. 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.

Pseudo-Code (Wikipedia)

1) Choose two distinct prime numbers p and q.
    For security purposes, the integers p and q should be chosen at random, and should be of similar bit-length. Prime integers can be efficiently found using a primality test.
2) Compute n = pq.
    n is used as the modulus for both the public and private keys
3) Compute phi(n) = (p1)(q1), where phi is Euler's totient function.
4) Choose an integer e such that 1 < e < phi(n) and greatest common divisor of (e, phi(n)) = 1; i.e., e and phi(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 0x10001 = 65,537. However, small values of e (such as 3) have been shown to be less secure in some settings.
5) Determine d as:
    d = e^{-1} (mod phi(n))
        i.e., d is the multiplicative inverse of e mod phi(n).
        This is more clearly stated as solve for d given (de) mod phi(n) = 1
        This is often computed using the extended Euclidean algorithm.
        d is kept as the private key exponent.

Examples

p=61;//integer
q=53;//integer
e=17;//public exponent
[n,d]=NARVAL_S_RSAe(p,q,e);//application of NARVAL_S_RSAe
//public key
[n e]
//private key
[n d]

Authors

Foued Melakessou

Contact

Dr. Foued Melakessou

Research Associate

Interdisciplinary Centre for Security, Reliability and Trust

Room F106

University of Luxembourg

6, rue Coudenhove Kalergi

L-1359 Luxembourg-Kirchberg

E-mail: foued.melakessou@uni.lu

Tel: (+352) 46 66 44 5346

Home Page


<< NARVAL_S_RSAEncryption NARVAL NARVAL_T_BarabasiAlbert >>