Skip to content

Application let user to encrypt, decrypt and generate key pair using RSA asymetric encryption. Written in WPF using .NET 5.0.8

License

Notifications You must be signed in to change notification settings

AdisonCavani/RSA-WPF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSA

name name

Application let user to encrypt, decrypt and generate key pair using RSA asymetric encryption.
It can be used to send symetric key like AES or short message - depending on key lenght (longer key = longer message).


Get started

Installation

Installing application

Download latest .zip package from here.
Unzip and run setup.exe. Follow installer instructions.

Supported OS

Currently this application support only Windows.
In the future I might port app to Linux with GTK or MAUI.

FAQ

How to use this?

You can watch this explanatory video or read example below.

Alice want to send a message to Bob. Of course we don't want to send unencrypted message, because somebody can read our private messages. Bob need to generate a key pair - public and private key. Then, Bob will send his public key to Alice and she will encrypt her message using Bob's public key. After encrypting message, Alice will send encrypted message (cipher) to Bob. Message is secure, because you can only decrypt message using Bob's private key. When Bob receive encrypted message, he will decrypt it using his private key.

Encrypting plain text with public key is a one-way operation - it cannot be undone using public key.

What key size should I use?

512 bit key is unsafe and it can be cracked in a few seconds on modern PC. Currently longest cracked key is 795 bits.
My recommendation is to use 2048 bit keys just like TLS protocol.
Be aware that longer key will use more resources and slow down encryption, decryption and key generation.
With every doubling of the RSA key length, decryption is 6-7 times times slower.

Key lenght Security
512 bit Unsafe, can be cracked in a few seconds
1024 bit Not recommended
2048 bit Recommended minimum
3072 bit Longer is better, use if you can afford it
4096 bit Longer is better, use if you can afford it

Message complexity problem

Main limitation of RSA algorithm is a limit of data lenght.
Short key will limit message lenght.
If you exceed data limit, you will get "cryptographic exception" dialog.

Key lenght Data
512 bit 26 characters
1024 bit 58 characters
2048 bit 122 characters
3072 bit 186 characters
4096 bit 250 characters

How should I store my private and public key?

The best solution is to use a offline password manager, for example: KeePassXC.
Do not store private key in .txt file or any other unencrypted file!

Errors and exceptions

Cryptographic exception

This might cause this exception:

Format exception

This might cause this exception:

  • entering key in wrong format
  • entering cipher in wrong format

Technical details

NuGet packages in use

Handling updates

By default application is checking for an update every 3 days. You can change that behaviour in settings. In order to update the app, you need to download latest release and install update

About

Application let user to encrypt, decrypt and generate key pair using RSA asymetric encryption. Written in WPF using .NET 5.0.8

Resources

License

Stars

Watchers

Forks

Languages