1. Trang chủ
  2. » Công Nghệ Thông Tin

mã hóa SHA1 trong lập trình c

1 628 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 1
Dung lượng 11,54 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

public static string EncryptPasswordstring Password { System.Text.UnicodeEncoding encoding = new System.Text.UnicodeEncoding; byte[] hashBytes = encoding.GetBytesPassword; //Compute th

Trang 1

public static string EncryptPassword(string Password)

{

System.Text.UnicodeEncoding encoding = new System.Text.UnicodeEncoding(); byte[] hashBytes = encoding.GetBytes(Password);

//Compute the SHA-1 hash

SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider();

byte[] cryptPassword = sha1.ComputeHash(hashBytes);

return BitConverter.ToString(cryptPassword);

}

Ngày đăng: 22/08/2016, 16:39

TỪ KHÓA LIÊN QUAN

w