Groups | Blog | Home
all groups > dotnet security > august 2005 >

dotnet security : Negative numbers in encryption key


Corleen
8/18/2005 12:21:02 PM
Hello
I've written a simple .net 1.1 class that uses the cryptography classes to
encrypt/decrypt using DES. My client just sent me their key which contains
negative numbers for example - byte[] keyBytes = {103, -39, -110, 62, -100,
37, -29, 59}; I know they use Java at their shop which I believe allows this.

I'm not sure how to handle this in my app since I can't put negative numbers
into a byte array. Can anyone help or direct me to some sample code to
handle this ?

Thanks!!!
Chris Priede
8/19/2005 2:57:19 AM
[quoted text, click to view]

int foo = -1;
byte bar = (byte)foo;
Console.WriteLine(bar); // prints 255

--
Chris Priede (priede@panix.com)

AddThis Social Bookmark Button