Click here to Skip to main content
15,891,316 members
Home / Discussions / C#
   

C#

 
GeneralRe: sqlDataAdapter Recommendation Pin
Mazdak27-Aug-03 23:16
Mazdak27-Aug-03 23:16 
GeneralRe: sqlDataAdapter Recommendation Pin
Ista28-Aug-03 3:20
Ista28-Aug-03 3:20 
GeneralCurly braces matcher Pin
thedex27-Aug-03 13:44
thedex27-Aug-03 13:44 
GeneralRe: Curly braces matcher Pin
Ista27-Aug-03 17:36
Ista27-Aug-03 17:36 
GeneralRe: Curly braces matcher Pin
Frank Olorin Rizzi28-Aug-03 1:34
Frank Olorin Rizzi28-Aug-03 1:34 
Generalhttp post Pin
Jan Vercauteren27-Aug-03 13:04
Jan Vercauteren27-Aug-03 13:04 
GeneralRe: http post Pin
Kannan Kalyanaraman27-Aug-03 23:09
Kannan Kalyanaraman27-Aug-03 23:09 
GeneralRe: http post Pin
Jan Vercauteren28-Aug-03 6:42
Jan Vercauteren28-Aug-03 6:42 
GeneralDataGrid - Click anywhere and act like you clicked to the far left. Pin
mikemilano27-Aug-03 10:46
mikemilano27-Aug-03 10:46 
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 
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 
norm wrote:
STEP 1: say once you have determined the legal size:
max 128
min 16
skip 16
STEP 2: Your key legal size is therefore: {16, 32, 48, 56... 128}


No, you're mistaking the size for the possible values. The size is the length of that array. The possible values for System.Byte are still going to be 0 to 255. That just means that the legal key size has to be an array with between 16 bytes and 128 bytes in it.

norm wrote:
STEP 4: 56 bits = 4 x16bits = 4 HEX number = {HEX1, HEX2, HEX3, HEX4} (Is this correct?)

Again, no, you're mistaking the possible values in the array for the length of the array.

norm wrote:
QUESTION 2:
Also, instead of:

byte[] MyKey = {0x10, 0x12, 0x0A, 0x3B}

Could I have generated it programmatically? Or can I load a key from a key file generated by sn.exe?


Yes! In fact, that's what I always do. I usually do something like this:

string myPassword<br />
byte[] passBytes = System.Text.Encoding.Default.GetBytes(myPassword);


And then I take passBytes, trim it down to the legal size (actually, it always fits within the legal size for RSA), and then give that to the RSA CSP. As for pulling from an sn.exe generated file, sure. I don't see why not, especially since that's generated (I believe) for RSA.

norm wrote:
QUESTION 3:
Do I have to rely on CryptoAPI to gain access to a key in cert store - and perhaps all other tasks that has to do with cert store?


No. I don't believe so. At least that's not what they say http://www.gotdotnet.com/team/clr/cryptofaq.htm[^]:

10. Does the crypto library have a key management system different from CryptoAPI?

No, we internally use CryptoAPI key storage and you can reference keys stored in CryptoAPI key containers by using the CspParameters object. For a sample of how to store and retrieve your own asymmetric key pair in CryptoAPI key storage see the sample on www.gotdotnet.com/team/clr/about_security.aspx.


However, I couldn't find that sample. You may have to go hunting in the MSDN docs. Although, the most valuable thing I saw on that "Sample" page was this:

The Source Code for the .NET Framework Cryptography Classes[^] Cool | :cool:


I passionately hate the idea of being with it, I think an artist has always to be out of step with his time.
-Orson Welles

GeneralRe: .NET crypto Pin
devvvy28-Aug-03 0:34
devvvy28-Aug-03 0:34 

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.