Tuts 4 You

• entries
10
3
• views
40,717

# DobReXor RSA / AES / Implementation

2,096 views

Just a few updates on DobReXor, I've managed to finish one of the most important classes which executes the following instructions. I will explain more in detail next week when time permits. I have attached the encrypted, decrypted, files along with the public and private keys for anyone who wants to analyse them. Please send all questions here or feel free to comment on my blog.

D1N

Target - notes.txt

AES/RSA/Encryption/Decryption usage

Result - notes.enc

RSA Algorithm

Key Generation:

1. Generate two large random primes, p and q, of approximately equal size such that their product n = pq is of the required bit length, e.g. 1024 bits. [see note 1].

2. Compute n = pq and (φ) phi = (p-1)(q-1).

3. Choose an integer e, 1 < e < phi, such that gcd(e, phi) = 1. [see note 2].

4. Compute the secret exponent d, 1 < d < phi, such that ed ≡ 1 (mod phi). [see note 3].

5. The public key is (n, e) and the private key is (n, d). Keep all the values d, p, q and phi secret.

* n is known as the modulus.

* e is known as the public exponent or encryption exponent or just the exponent.

* d is known as the secret exponent or decryption exponent.

File Encryption

Sender A does the following:-

1. Obtains the recipient B's public key (n, e).

2. Represents the plaintext message as a positive integer m [see note 4].

3. Computes the ciphertext c = me mod n.

4. Sends the ciphertext c to B.

File Decryption

Recipient B does the following:-

1. Uses his private key (n, d) to compute m = cd mod n.

2. Extracts the plain-text from the message representative m.

There are no comments to display.