- Run "link of gitlab repo".
- Run requirements.sh.
- Run Python3 run.py.
The RSA algorithm is a public key algorithm that can be used to send an encrypted message without a separate exchange of secret keys. It can also be used to sign a message.
public key and private keys are generated. Two random unequal large primes are generated (p,q). Compute n = p * q Compute phi(n) = (p-1) * (q-1) Select ‘e’ such that gcd (e, phi(n)) = 1 Compute d = e -1 mod phi(n)
Public key is (e, n). Private key is d.
Encryption: The encrypted msg is C=M^e mod n. where M is input(string). C is in ciphertext.
The decrypted msg is M=C^d mod n. we get M back.
- app/app.py/generate(sz,e) sz=size of key. e(optional) Returns n, e, p, q, d % (p-1), d % (q-1), coeff, d.
- app/app.py/encrypt(message,n,e) message: The message to be encrypted n: The public key e: The exponent in the public key Returns the encrypted message.
- app/app.py/decrypt(crypto, n, e, d, p, q) crypto: the cryptographically encrypted msg rest all arguments as in theory.
- app/static contains all the js,css files and images.
- app/templates contains all the html pages.
The working of all these functions is using the python library 'rsa'.
'url'/show_all
- Factory pattern while initializing the database. An empty constructor is used to create an instant of the database object in the models.py file but the app context is added in app.py.
- Singleton pattern while initializing the database. There cannot exist two different instants of the database object at some point of time, that is why a singleton pattern is alays used when initializing a database connection object.