Ask a Question related to ASP.NET Security, Design and Development.
-
Jagadeesh #1
Can any one explain this code bolck in detail.
hi,
here is the block :
public static string Password_Encrypt(String strPassword)
{
Byte[] arrDESKey;
Byte[] arrDESIV;
Byte[] arrInput;
Byte[] arrOutput;
arrDESKey = StringToByte(Promotions.Common.Constants.DESKey);
arrDESIV = StringToByte(Promotions.Common.Constants.DESIV);
// method to convert str to byte
arrInput = StringToByte(strPassword);
arrOutput= StringToByte("");
DESCryptoServiceProvider ObjDES = new DESCryptoServiceProvider();
ICryptoTransform ObjEncryptor = ObjDES.CreateEncryptor(arrDESKey,arrDESIV);
FileStream ObjFileStream = new FileStream(Path.GetTempPath() +
"/secret.txt",FileMode.Create,FileAccess.Write);
CryptoStream ObjCryptoStream = new
CryptoStream(ObjFileStream,ObjEncryptor,CryptoStre amMode.Write);
ObjCryptoStream.Write(arrInput,0,arrInput.Length);
ObjCryptoStream.Close();
FileStream fs = new FileStream(Path.GetTempPath() + "/secret.txt",
FileMode.Open, FileAccess.Read);
arrOutput= new Byte[fs.Length];
fs.Read(arrOutput,0,arrOutput.Length);
fs.Close();
File.Delete(Path.GetTempPath() + "/secret.txt");
Encoding encoding = Encoding.UTF7;
try{
return encoding.GetString(arrOutput);
}
catch
{
return strPassword;
}
}
regards
Jagadeesh
Jagadeesh Guest
-
Can someone explain this MySQL code fragment
What does the this bit of code do? I LOCK TABLES `phplist_listattr_comments` WRITE; UNLOCK TABLES; I'm learning PHP/Mysql running on a cheap... -
Please explain this very short bit of code for me?
Simple question. I don't understand what this code is saying, and can't find anything like it at PHP.net I'll admit I haven't looked really hard. ... -
Can Someone Explain (No Pun Intended) this Explain Plan Output ?
We're running DB2 v7.1 on OS/390. The DBA guys gave us a macro to generate an explain plan against a query that is stored in a PDS member. The... -
Can anyone explain why call proc won't work in this code ?
Hi all, I'm trying to write a sql file to load up some initial data into a database. Some of the loading is done by calling procedures and getting... -
please can someone explain the following code.
Hi Christian, Thanks for the reply, but this is what I don't understand..... (by the way there was a typo in my last message: "dpPageInit" should...



Reply With Quote

