LivePhoto개발

C# HMAC-SHA1 암호화

푸헐남아 2010. 11. 9. 16:45
using System.Security.Cryptography;

.....


byte[] secretkey = System.Text.Encoding.UTF8.GetBytes("키");

byte[] contents = System.Text.Encoding.UTF8.GetBytes("내용");

HMACSHA1 hmacsha1 = new HMACSHA1(secretkey);

byte[] hashValue = hmacsha1.ComputeHash(contents);

string oauth_signature = Convert.ToBase64String(hashValue);