Asymmetric cryptography using Angular 9 and Asp.net Web Api
Introduction
Nothing better than to learn something new during our free time. A new programming language, why not. Thus to make my mind busy as a geek i tried to learn Angular 9 and create a small application nothing fancy at all and called it Asymmetric cryptography. In simple words using Angular 9 to create the client side application and hooked it up with an ASP.NET web api. To conclude i deployed the application on Microsoft azure.
How it works
Key generation
Asymmetric cryptography uses 2 key pairs to encryption and decryption data. The 2 keys consist of a private key and a public key. To produce a cipher text (encryption), the public key alongside with the plain text will be used. In the same way, in order to produce a plain text (decryption) the cipher text will be used with the private key.
The images below illustrate how asymmetric cryptography works:
To use the application first select the key length namely:
- 512 bit
- 1024 bit
- 2048 bit
- 4096 bit
Click on generate to generate a new key pairs. To copy those keys simply click on the button on the right of each key.
Encryption
- Use the public key previously generated
- enter a plain text that you want to encrypt
- Click on the encryption button
- The cipher text will be generated using the public key and plaint text
- Snack bar to indicate if the process was successful
Decryption
- Select the decrypt tab
- Enter the private key generated in previously
- Enter the cipher text which was generated previously also.
- Click on decrypt button
- Using the private key to revert the cipher text to the origin plain text
Source code
Client side
Generate keys
Links
Client side source code: https://github.com/kaveer/AsymetricCryptogrsphy.git
Api source code: https://github.com/kaveer/AsymetricCryptographyApi.git
Application link on Azure: https://aymmetric.azurewebsites.net/
Buy me a coffee: https://www.paypal.com/paypalme2/Rajcoomar
Comments
Post a Comment