https://github.com/theodoreai/crypto-system
The following is a crypto system library that is written in C++ and it implements the RSA system.
https://github.com/theodoreai/crypto-system
Last synced: about 1 year ago
JSON representation
The following is a crypto system library that is written in C++ and it implements the RSA system.
- Host: GitHub
- URL: https://github.com/theodoreai/crypto-system
- Owner: TheodoreAI
- Created: 2023-02-09T03:15:39.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-11T01:26:49.000Z (over 3 years ago)
- Last Synced: 2025-02-01T02:49:07.731Z (over 1 year ago)
- Language: C++
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# C++ RSA Library
#### Mateo Estrada Jorge
#### Feb 08, 2023
- Crypto system for a non-production level system. The following would need a good pseudorandom generator and could be implemented as an API/service to generate public/private keys.
### The system is written for RSA:
- It is a public-key cryptosystem that is widely used for secure data transmission.
- The security of RSA is based on the mathematical problem of factorization, i.e., it is hard to factorize a large composite number into its prime factors.
- Key Generation: Select two large prime numbers, p and q, and compute n = p * q. Compute φ(n) = (p - 1) * (q - 1) and select a public key exponent, e, such that 1 < e < φ(n) and e is coprime to φ(n). Compute a private key exponent, d, such that d * e ≡ 1 (mod φ(n)).
- Encryption: Given a message m and a public key (n, e), the encryption is computed as c ≡ m^e (mod n).
- Decryption: Given a ciphertext c and a private key d, the decryption is computed as m ≡ c^d (mod n).
- Complexity: The encryption and decryption operations in RSA are both exponential in the number of bits in the key size, making it relatively slow for larger key sizes.
# Basic Requirements:
1. Key Generation: The library should have a function for generating RSA key pairs, including both public and private keys.
2. Key Storage: The library should have the ability to securely store the generated keys, either on disk or in memory.
3. Key Encryption: The library should have the ability to encrypt messages using the public key.
4. Key Decryption: The library should have the ability to decrypt messages using the private key.
5. Key Size: The library should support key sizes ranging from 512 to 4096 bits.
6. Modulus Generation: The library should have a function for generating a modulus that meets the required security standards.
7. Prime number generation was done with a pseudorandom prime generator with values < 1000.
8. Encryped messages are output in encrypted.txt file
9. Decrypted messages are output in decrypted.txt file