vb.net - Encrypting a file with RSA in Visual Basic .NET -


I am just starting with Visual Basic.NET and I am currently stuck on the following problem: How can I encrypt / decrypt a file with asymmetric encryption

Essentially, I'm trying to figure out how I can write the following pseudocode in VB:

  function EncryptFile (path_to_file_to_encrypt, public_key) file = ReadFile (path_to_file_to_encrypt) encr Ypted_file = Encrypt SaveToDisk (encrypted_file, "C: \ encrypted \ encryptedfile.xxx") termination function function DecryptFile (path_to_encrypted_file, private_key) encrypted_file = ReadFile (path_to_encrypted_file) file = decrypt (file, private_key) SaveToDisk (file, "C: \ decrypted \ file.xxx") Ending function  

The file I am trying to encrypt / decrypting is an access database file (ie binary), if it does not matter .

I think there are containers for the private key, but it seems that for me this figure is quite a bit, I guess I hardly code the public key in my code (it did not change Will be).

Any help would be appreciated!

Usually, an RSA "key encryption key" for a symmetric algorithm "content" Encryption key "is used to encrypt. That content encryption key is used to encrypt the file.

Protocols like SSL, S / MIME, and PGP can use this approach (sometimes called major transport). Asymmetric cryptography is very, very slow compared to symmetric algorithms.

Something like the S / MIME library for VB.NET can handle this task.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -