Click here to Skip to main content
15,888,803 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionRe: Collapse/Expand functionality in a ListView with Groups Pin
led mike30-Jul-08 5:24
led mike30-Jul-08 5:24 
Questionvb.NET programming error Pin
kann.2729-Jul-08 21:51
kann.2729-Jul-08 21:51 
AnswerRe: vb.NET programming error Pin
unknown78930-Jul-08 0:33
unknown78930-Jul-08 0:33 
AnswerRe: vb.NET programming error Pin
Ashfield31-Jul-08 9:17
Ashfield31-Jul-08 9:17 
QuestionEncrypting Passwords in .NET application Pin
aspnet2.developer28-Jul-08 20:59
aspnet2.developer28-Jul-08 20:59 
AnswerRe: Encrypting Passwords in .NET application Pin
Rob Philpott28-Jul-08 22:41
Rob Philpott28-Jul-08 22:41 
GeneralRe: Encrypting Passwords in .NET application Pin
supercat929-Jul-08 19:48
supercat929-Jul-08 19:48 
GeneralRe: Encrypting Passwords in .NET application Pin
Mark Churchill30-Jul-08 17:12
Mark Churchill30-Jul-08 17:12 
GeneralRe: Encrypting Passwords in .NET application Pin
supercat930-Jul-08 18:22
supercat930-Jul-08 18:22 
AnswerRe: Encrypting Passwords in .NET application [modified] Pin
Yajnesh Narayan Behera30-Jul-08 20:19
Yajnesh Narayan Behera30-Jul-08 20:19 
In my project requirement was same as of your. There is two approach two encrypt as the code level & database level, but I took the code level approach. Although I am not an expert in this area would like to know whether my approach was correct or not also it may answer your query.

I used some class provided by .NET framework.


private static string Encrypt(string originalString)
{

 DESCryptoServiceProvider cryptoProvider = new DESCryptoServiceProvider();
 MemoryStream memoryStream = new MemoryStream();

 CryptoStream cryptoStream = new CryptoStream(memoryStream,  cryptoProvider.CreateEncryptor(bytes, bytes), CryptoStreamMode.Write);

 StreamWriter writer = new StreamWriter(cryptoStream);
 writer.Write(originalString);
 writer.Flush();
 cryptoStream.FlushFinalBlock();
 writer.Flush();

 return Convert.ToBase64String(memoryStream.GetBuffer(), 0, (int) memoryStream.Length);

}


Now the returned string is in encrypted format & can be inserted in the database.

modified on Thursday, July 31, 2008 2:33 AM

GeneralRe: Encrypting Passwords in .NET application Pin
Mark Churchill30-Jul-08 20:54
Mark Churchill30-Jul-08 20:54 
QuestionCreate database from DBML file Pin
Manuel Then28-Jul-08 5:47
Manuel Then28-Jul-08 5:47 
AnswerRe: Create database from DBML file Pin
Sam Xavier31-Jul-08 18:48
Sam Xavier31-Jul-08 18:48 
GeneralRe: Create database from DBML file Pin
Manuel Then31-Jul-08 21:23
Manuel Then31-Jul-08 21:23 
AnswerRe: Create database from DBML file Pin
MisterX4424-Mar-09 10:49
MisterX4424-Mar-09 10:49 
QuestionSqlServerCE and ASP.NET Configuration Pin
hammerstein0528-Jul-08 3:51
hammerstein0528-Jul-08 3:51 
AnswerRe: SqlServerCE and ASP.NET Configuration Pin
led mike28-Jul-08 9:59
led mike28-Jul-08 9:59 
GeneralRe: SqlServerCE and ASP.NET Configuration Pin
hammerstein0528-Jul-08 13:05
hammerstein0528-Jul-08 13:05 
Questionproblem writing a file on my desktop Pin
unknown78928-Jul-08 2:48
unknown78928-Jul-08 2:48 
AnswerRe: problem writing a file on my desktop Pin
Paul Conrad28-Jul-08 18:24
professionalPaul Conrad28-Jul-08 18:24 
GeneralRe: problem writing a file on my desktop Pin
unknown78928-Jul-08 23:04
unknown78928-Jul-08 23:04 
GeneralRe: problem writing a file on my desktop Pin
unknown78930-Jul-08 0:28
unknown78930-Jul-08 0:28 
QuestionMagic: Application runs sometimes and fails sometimes Pin
Muhammad Gouda27-Jul-08 5:10
Muhammad Gouda27-Jul-08 5:10 
AnswerRe: Magic: Application runs sometimes and fails sometimes Pin
Oshtri Deka28-Jul-08 0:26
professionalOshtri Deka28-Jul-08 0:26 
GeneralRe: Magic: Application runs sometimes and fails sometimes Pin
Muhammad Gouda28-Jul-08 2:15
Muhammad Gouda28-Jul-08 2:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.