Click here to Skip to main content
15,884,861 members
Home / Discussions / C#
   

C#

 
GeneralRe: DataGrid - Click anywhere and act like you clicked to the far left. Pin
A.Wegierski27-Aug-03 19:49
A.Wegierski27-Aug-03 19:49 
QuestionHow to make shift/Ctrl Key press work within Datagrid? Pin
Chris#27-Aug-03 10:37
Chris#27-Aug-03 10:37 
GeneralImageList Pin
Katrina Gee27-Aug-03 8:17
Katrina Gee27-Aug-03 8:17 
GeneralRe: ImageList Pin
Ista28-Aug-03 3:22
Ista28-Aug-03 3:22 
QuestionC# & mySQL - What Driver To Use? Pin
mikemilano27-Aug-03 8:10
mikemilano27-Aug-03 8:10 
AnswerRe: C# & mySQL - What Driver To Use? Pin
Daniel Turini27-Aug-03 12:19
Daniel Turini27-Aug-03 12:19 
AnswerRe: C# & mySQL - What Driver To Use? Pin
zecodela27-Aug-03 22:28
zecodela27-Aug-03 22:28 
General.NET crypto Pin
devvvy27-Aug-03 8:01
devvvy27-Aug-03 8:01 
I am just reading thru some dot-net samples on cryptography. The samples are very good and to-the-point, man, great step forward from the old-days. There're still a few things...

QUESTION 1: A key is a byte array, okay, I have no problem with this. But is the following Key = array of sixteen HEX number? Meaning, 16x16=256bit key? Is HEX number denoted by "0x"? But shouldnt "0x10" be written as "0xA" instead?

RijndaelManaged RMCrypto = new RijndaelManaged();

byte[] Key = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16};
byte[] IV = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16};

//Create a CryptoStream, pass it the NetworkStream, and encrypt
//it with the Rijndael class.
CryptoStream CryptStream = new CryptoStream(NetStream,
RMCrypto.CreateEncryptor(Key, IV),
CryptoStreamMode.Write);

QUETSION 2: For RSA algo, public key is not an array of HEX as in case of RijndaelManaged algo. But how do I know how I should construct the public key? I understand you can check "LegalKeySizes". But say Legal key size is:
min 16 (bits)
max 32 (bits)
skip 8 (bits)
Then what? An int32 is 32 bits wide. Does it mean I can have ONE int32 in the byte array?
int32 someint = 12;
byte[] MyKey = {someint};
If so, the following key looks pretty long to me:

byte[] PublicKey = {214,46,220,83,160,73,40,39,201,155,19,202,3,11,191,178,56,
74,90,36,248,103,18,144,170,163,145,87,54,61,34,220,222,
207,137,149,173,14,92,120,206,222,158,28,40,24,30,16,175,
108,128,35,230,118,40,121,113,125,216,130,11,24,90,48,194,
240,105,44,76,34,57,249,228,125,80,38,9,136,29,117,207,139,
168,181,85,137,126,10,126,242,120,247,121,8,100,12,201,171,
38,226,193,180,190,117,177,87,143,242,213,11,44,180,113,93,
106,99,179,68,175,211,164,116,64,148,226,254,172,147};

byte[] Exponent = {1,0,1};

... some code ...

//Create a new instance of RSACryptoServiceProvider.
RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();

//Create a new instance of RSAParameters.
RSAParameters RSAKeyInfo = new RSAParameters();

//Set RSAKeyInfo to the public key values.
RSAKeyInfo.Modulus = PublicKey;
RSAKeyInfo.Exponent = Exponent;


norm
GeneralRe: .NET crypto Pin
David Stone27-Aug-03 11:19
sitebuilderDavid Stone27-Aug-03 11:19 
GeneralRe: .NET crypto Pin
devvvy27-Aug-03 13:18
devvvy27-Aug-03 13:18 
GeneralRe: .NET crypto Pin
devvvy27-Aug-03 13:35
devvvy27-Aug-03 13:35 
GeneralRe: .NET crypto Pin
devvvy27-Aug-03 13:38
devvvy27-Aug-03 13:38 
GeneralRe: .NET crypto Pin
David Stone27-Aug-03 20:38
sitebuilderDavid Stone27-Aug-03 20:38 
GeneralRe: .NET crypto Pin
David Stone27-Aug-03 20:31
sitebuilderDavid Stone27-Aug-03 20:31 
GeneralRe: .NET crypto Pin
David Stone27-Aug-03 20:24
sitebuilderDavid Stone27-Aug-03 20:24 
GeneralRe: .NET crypto Pin
devvvy28-Aug-03 0:34
devvvy28-Aug-03 0:34 
GeneralRe: .NET crypto Pin
David Stone28-Aug-03 9:06
sitebuilderDavid Stone28-Aug-03 9:06 
GeneralExtract Heading from a word doc Pin
kanch eramudu27-Aug-03 5:29
kanch eramudu27-Aug-03 5:29 
GeneralAttachment with Outlook express Pin
Velichko Sarev27-Aug-03 1:53
Velichko Sarev27-Aug-03 1:53 
GeneralAdministrator Privileges Pin
Manoj_kr7427-Aug-03 0:42
Manoj_kr7427-Aug-03 0:42 
GeneralRe: Administrator Privileges Pin
Kannan Kalyanaraman27-Aug-03 1:11
Kannan Kalyanaraman27-Aug-03 1:11 
GeneralRe: Administrator Privileges Pin
Mazdak27-Aug-03 8:51
Mazdak27-Aug-03 8:51 
Generalstore users settings Pin
Member 50926226-Aug-03 23:30
Member 50926226-Aug-03 23:30 
GeneralRe: store users settings Pin
Kannan Kalyanaraman27-Aug-03 1:19
Kannan Kalyanaraman27-Aug-03 1:19 
GeneralRe: store users settings Pin
Member 50926227-Aug-03 10:47
Member 50926227-Aug-03 10:47 

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.