Upload to server
uploading
This commit is contained in:
33
patientman/PatientMan/strUtil.cs
Normal file
33
patientman/PatientMan/strUtil.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Security.Cryptography;
|
||||
namespace PatientMan
|
||||
{
|
||||
|
||||
public static class strUtil
|
||||
{
|
||||
|
||||
private static byte[] key = new byte[8] { 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
private static byte[] iv = new byte[8] { 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
|
||||
public static string Crypt(this string text)
|
||||
{
|
||||
//SymmetricAlgorithm algorithm = DES.Create();
|
||||
//ICryptoTransform transform = algorithm.CreateEncryptor(key, iv);
|
||||
//byte[] inputbuffer = Encoding.Unicode.GetBytes(text);
|
||||
//byte[] outputBuffer = transform.TransformFinalBlock(inputbuffer, 0, inputbuffer.Length);
|
||||
return text; // Convert.ToBase64String(outputBuffer);
|
||||
}
|
||||
|
||||
public static string Decrypt(this string text)
|
||||
{
|
||||
//SymmetricAlgorithm algorithm = DES.Create();
|
||||
//ICryptoTransform transform = algorithm.CreateDecryptor(key, iv);
|
||||
//byte[] inputbuffer = Convert.FromBase64String(text);
|
||||
//byte[] outputBuffer = transform.TransformFinalBlock(inputbuffer, 0, inputbuffer.Length);
|
||||
return text; // Encoding.Unicode.GetString(outputBuffer);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user