1. I know I need to use .Net's cryptography class.
2. If you look at the example, I need to convert these lines to C#. Any ideas?
// Use Java Cryptography functions to generate the x_fp_hash value// generate secret key for HMAC-SHA1 using the transaction keySecretKey key = new SecretKeySpec(transactionKey.getBytes(), "HmacSHA1");
// Get instance of Mac object implementing HMAC-SHA1, and// Initialize it with the above secret keyMac mac = Mac.getInstance("HmacSHA1");mac.init(key);
Dim sym As New Encryption.Symmetric(Encryption.Symmetric.Provider.TripleDES)Dim key As New Encryption.Data("My Password")Dim fs As New IO.FileStream("c:\test.txt", IO.FileMode.Open, IO.FileAccess.Read)Dim br As New IO.BinaryReader(fs)Dim encryptedData As Encryption.DataencryptedData = sym.Encrypt(br.BaseStream, key)br.Close()
http://www.codeproject.com/Articles/10154/NET-Encryption-Simplified
Open in new window