Commit Graph

13 Commits

Author SHA1 Message Date
d23b2d4ae0
test file. Consider writing 'words' to file instead of saving
a list in memory.

Signed-off-by: HeshamTB <hishaminv@gmail.com>
2020-04-17 04:43:03 +03:00
f9ff56651d
rsa gen: cleaner stdout with carriage return. (printing to the same line)
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2020-04-17 04:40:31 +03:00
b2dc176d40
Changed key representation to hex r-16.
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2020-04-17 04:38:09 +03:00
168f8a2b66
gitignore file
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2020-04-17 04:34:41 +03:00
db2a852cf3
isPrime() function/algo optimization:
insted of taking all integers from 2 to K, take only odds
	since we know that the even prime is 2. This should in theory
	reduce the time to check primilaty to half.
2020-04-16 21:51:36 +03:00
1954308cb4
improved interface
- Accept key generation size. (not practical above 64-bit)
	- Decrypt from command args only for now
	- Catch Unicode Decode Error cuased by wong key or size.
2020-04-16 18:56:04 +03:00
feeea933c3
Working interface.
- Encrypt a signle word message. for now
    - Decrypt only with target private key
    - Runtime errors when using wrong key to decrypt or message too long.
2020-04-16 14:33:24 +03:00
a1e05a572a
Interfacing changes:
- Split into methods.
    - Added a cli interface with commands 'gen <filename>' to generate keys
      and 'encrypt <message> <publicKey>' to encrypt a message
      to the passed key.
    - Read and save keys.
2020-04-16 12:40:48 +03:00
4bd8fcf1dd
A 128-bit key pair saved. Took 15 minutes to generate on (Intel i7-4710MQ (8) @ 3.500GHz) single thread. 2020-04-16 09:51:08 +03:00
1993551a59
Working key pair generation, encryption and decryption
TODO:
   - Clean up
   - Split into methods
   - Save a key pair in a file (interactivly)?
2020-04-16 09:48:31 +03:00
1a591cc75e
getPrime() method working. gets random prime based on bit size. 2020-04-16 05:54:36 +03:00
7fe7065700
isPrime() method working with good accuracy. needs more testing. 2020-04-16 05:11:00 +03:00
9f5d9fe5a5
init commit 2020-04-16 00:05:03 +03:00