Click here to Skip to main content
15,890,512 members
Home / Discussions / C#
   

C#

 
QuestionRich Text Box Questions Pin
Peter Sbarski6-Jun-06 21:09
Peter Sbarski6-Jun-06 21:09 
AnswerRe: Rich Text Box Questions Pin
Mairaaj Khan6-Jun-06 21:50
professionalMairaaj Khan6-Jun-06 21:50 
QuestionUsing TripleDES Encryption [modified] Pin
cybersurferdev6-Jun-06 20:45
cybersurferdev6-Jun-06 20:45 
AnswerRe: Using TripleDES Encryption [modified] Pin
stancrm6-Jun-06 21:21
stancrm6-Jun-06 21:21 
GeneralRe: Using TripleDES Encryption [modified] Pin
cybersurferdev6-Jun-06 21:38
cybersurferdev6-Jun-06 21:38 
AnswerRe: Using TripleDES Encryption [modified] Pin
Kodanda Pani6-Jun-06 21:31
Kodanda Pani6-Jun-06 21:31 
GeneralRe: Using TripleDES Encryption [modified] Pin
cybersurferdev6-Jun-06 21:42
cybersurferdev6-Jun-06 21:42 
GeneralRe: Using TripleDES Encryption [modified] Pin
Kodanda Pani6-Jun-06 22:10
Kodanda Pani6-Jun-06 22:10 
Hi,

If you want you can store the keys in web.config or else you can use registry etc. Store them as strings and covert them to Byte array while doing the encryption.

private static void GetKeys(byte[] Key, byte[] Vector)
{
string[] keystring;
string[] vectorstring;
byte[] intKey = new byte[24];
byte[] intVector = new byte[7];

strKey = System.Configuration.ConfigurationSettings.AppSettings["Key"];
strVector = System.Configuration.ConfigurationSettings.AppSettings["Vector"];
keystring = strKey.Split(new char[]{','});

vectorstring= strVector.Split(new char[]{','});
//build the keys
for(int i=0; i<23; i++)
{
intKey[i] = Convert.ToByte(strKey[i]);

}
for(int i=0; i<7; i++)
{
intVector[i] = Convert.ToByte(strVector[i]);
}
byte[] intLocalKey = {intKey[0], intKey[1], intKey[2], intKey[3], intKey[4], intKey[5], intKey[6], intKey[7], intKey[8], intKey[9], intKey[10], intKey[11], intKey[12], intKey[13], intKey[14], intKey[15], intKey[16], intKey[17], intKey[18], intKey[19], intKey[20], intKey[21], intKey[22], intKey[23]};
byte[] intLocalVec = {intVector[0], intVector[1], intVector[2], intVector[3], intVector[4], intVector[5], intVector[6], intVector[7]};
Key = intLocalKey;
Vector = intLocalVec;
}

Regards,
Mahen
GeneralRe: Using TripleDES Encryption [modified] Pin
cybersurferdev6-Jun-06 22:49
cybersurferdev6-Jun-06 22:49 
GeneralRe: Using TripleDES Encryption [modified] Pin
Kodanda Pani7-Jun-06 0:03
Kodanda Pani7-Jun-06 0:03 
GeneralRe: Using TripleDES Encryption [modified] Pin
cybersurferdev6-Jun-06 23:32
cybersurferdev6-Jun-06 23:32 
GeneralRe: Using TripleDES Encryption [modified] Pin
Kodanda Pani7-Jun-06 0:04
Kodanda Pani7-Jun-06 0:04 
GeneralRe: Using TripleDES Encryption [modified] Pin
cybersurferdev7-Jun-06 0:10
cybersurferdev7-Jun-06 0:10 
GeneralRe: Using TripleDES Encryption [modified] Pin
Kodanda Pani7-Jun-06 0:20
Kodanda Pani7-Jun-06 0:20 
GeneralRe: Using TripleDES Encryption [modified] Pin
cybersurferdev7-Jun-06 1:45
cybersurferdev7-Jun-06 1:45 
AnswerRe: Using TripleDES Encryption [modified] Pin
leppie7-Jun-06 6:20
leppie7-Jun-06 6:20 
QuestionForm freezes on async webservice call Pin
Talal Sultan6-Jun-06 20:39
Talal Sultan6-Jun-06 20:39 
Questionhow to get the send items Pin
ayyp6-Jun-06 20:21
ayyp6-Jun-06 20:21 
AnswerRe: how to get the send items Pin
ranandbe6-Jun-06 21:10
ranandbe6-Jun-06 21:10 
Questionlistview: click on columnheader Pin
Ward6-Jun-06 19:56
Ward6-Jun-06 19:56 
AnswerRe: listview: click on columnheader Pin
rah_sin6-Jun-06 20:04
professionalrah_sin6-Jun-06 20:04 
GeneralRe: listview: click on columnheader Pin
Ward6-Jun-06 20:05
Ward6-Jun-06 20:05 
GeneralRe: listview: click on columnheader Pin
Ward6-Jun-06 20:10
Ward6-Jun-06 20:10 
QuestionCOM Interop Pin
skrishnasarma6-Jun-06 19:50
skrishnasarma6-Jun-06 19:50 
Questionwtsapi32.dll and hardwardid Pin
s8061k6-Jun-06 19:25
s8061k6-Jun-06 19:25 

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.