Encryption and .Net #19

Encryption and .Net

Dot net provides rich support for data encryption. the namespace System.Security.Cryptography includes the encryption features.There are three primary concepts related to encryption such as Hashing, Symmetric Encryption, and Asymmetric encryption. A hash is a data fingerprint, a small data that represents the uniqueness of a large block of data. In Symmetric Encryption, a single key is used for both encryption and decryption. In Asymmetric encryption, two different keys are used, one for encryption and another one for decryption. In real world applications, a combination of all three methods are used to provide better security.

A digital transmission of a check can be as follows: create the hash of the check, encrypt the hash with the public key using asymmetric encryption, apply the encrypted hash on the document, encrypt the symmetric encryption key with asymmetric encryption method, encrypt the check with symmetric encryption, transmit the encrypted key and encrypted document to the receiver

Hash Example

   hash = New Encryption.Hash(Encryption.Hash.Provider.CRC32)   data = New  Encryption.Data("Hash Browns")   hash.Calculate(data)

Symmetric example:

 sym = New Encryption.Symmetric(Encryption.Symmetric.Provider.Rijndael)  key = New Encryption.Data("Pass")   Encryption.Data encryptedData;  encryptedData = sym.Encrypt(New Encryption.Data("Secret"), key) string base64EncryptedString = encryptedData.ToBase64

Asymmetric Example

  asym = New Encryption.Asymmetric    pubkey = New Encryption.Asymmetric.PublicKey    privkey = New Encryption.Asymmetric.PrivateKey  asym.GenerateNewKeyset(pubkey, privkey) secret = "ancient chinese"  Encryption.Data encryptedData   encryptedData = asym.Encrypt(New Encryption.Data(secret), pubkey)   Encryption.Data decryptedData   asym2 = New Encryption.Asymmetric   decryptedData = asym2.Decrypt(encryptedData, privkey)

From: http://sitestree.com/?p=5334
Categories:19
Tags:
Post Data:2010-04-30 02:01:13

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>