RSA (Rivest Shamir Aldeman)
The Rivest Shamir Aldeman (RSA) algorithm is an algorithm used for public key encryption. RSA is used in security protocols such as SSL/TLS, SET, SSH, S/MIME, PGP, DNSSEC. The RSA cryptographic algorithm is designed to generate different keys in the encryption and decryption process of messages.
Location of the strength of the RSA algorithm is in the exponential process, and factoring a number into 2 prime numbers which until now requires a long time in factoring. The RSA scheme is taken from the block cipher scheme, where before encrypting, we need to divide the existing plaintext into blocks that have the same length, the plaintext and ciphertext are integers between 1-n, where n is usually 1024 bits in size, and block length is less than or equal to log(n) +1 with base 2.
There are two keys used in this RSA algorithm, namely the public key (the key used for encryption) and the private key (the key used to restore the original message). In the process, RSA requires three steps, including: key generation, encryption, and decryption.
Here are the steps to generate the key:
- Select two large prime numbers p and q. The values of p and q cannot be the same. The purpose of choosing large p and q values is to obtain a high level of security.
- Calculate n = p x q.
- Calculate m = (p-1) x (q-1).
- Determine the value of e with the conditions: . 1, it means that the largest divisor of m and e is 1.
- Finding d using the formula: e x d mod m = 1, we need to guess the value of d which when multiplied by e and mod by m then the result is 1.
- And we get a pair of keys: public key = (e,n) and private key = (d,n).
The purpose of generating the key is to be able to encrypt the message with the public key that has been obtained. The encryption formula is as follows:
C = Me(mod n)
To restore the original message, we need to take the obtained password message, and decrypt it with the following formula:
M = Cd(mod n)
Where:
C = Ciphertext
M = Message / Plaintext
e = Public key
d = Private key
n = Modulo