-
Notifications
You must be signed in to change notification settings - Fork 0
/
Crypt.cs
29 lines (27 loc) · 906 Bytes
/
Crypt.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;
namespace attendence_management_system
{
public class Crypt
{
public string encryption(String password)
{
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
byte[] encrypt;
UTF8Encoding encode = new UTF8Encoding();
//encrypt the given password string into Encrypted data
encrypt = md5.ComputeHash(encode.GetBytes(password));
StringBuilder encryptdata = new StringBuilder();
//Create a new string by using the encrypted data
for (int i = 0; i < encrypt.Length; i++)
{
encryptdata.Append(encrypt[i].ToString());
}
return encryptdata.ToString();
}
}
}