Click here to Skip to main content
15,913,722 members
Home / Discussions / C#
   

C#

 
GeneralRe: Theme Color Scheme Colors Pin
Tom John26-Jan-05 22:10
Tom John26-Jan-05 22:10 
GeneralI have a problem with my datagrid in my aplication Pin
tutananthanh25-Jan-05 22:58
tutananthanh25-Jan-05 22:58 
GeneralRe: I have a problem with my datagrid in my aplication Pin
Dave Kreskowiak26-Jan-05 6:19
mveDave Kreskowiak26-Jan-05 6:19 
GeneralRe: I have a problem with my datagrid in my aplication Pin
tutananthanh26-Jan-05 13:45
tutananthanh26-Jan-05 13:45 
GeneralRe: I have a problem with my datagrid in my aplication Pin
Dave Kreskowiak26-Jan-05 17:27
mveDave Kreskowiak26-Jan-05 17:27 
GeneralRe: I have a problem with my datagrid in my aplication Pin
jzb26-Jan-05 17:59
jzb26-Jan-05 17:59 
GeneralRe: I have a problem with my datagrid in my aplication Pin
Robert Rohde26-Jan-05 19:18
Robert Rohde26-Jan-05 19:18 
GeneralProblem with .NET DES encryption Pin
Radoslav Bielik25-Jan-05 22:45
Radoslav Bielik25-Jan-05 22:45 
Hi everyone,

I'm having a strange problem with DES encryption in .NET (DESCryptoServiceProvider). I'm using 3 implementations of DES, one in .NET, another in JavaScript and one in Java.

I'm encrypting the same short string with the same 8-byte key, using ECB mode. ALl implementations will return a 16-byte cipher text (two 64 bit blocks). The problem is that the first 64-bit block of the cipher text is the same for all three implementations, but the second 64-bit block is different in C#. THe same thing happens when using CBC with initialization vector.

I don't think that there is a problem with my C# code, another C# sample I have tried returned the same results, but here is the code I'm using. I have no clue what to do Frown | :(

MemoryStream memStream=new MemoryStream(100);

DES des=new DESCryptoServiceProvider();  
des.Mode=CipherMode.ECB;

// desKey is byte[] with 8 bytes,
// desIV is an empty byte[]
CryptoStream encStream = new CryptoStream(memStream, des.CreateEncryptor(desKey, desIV), CryptoStreamMode.Write);
			
encStream.Write(Encoding.UTF8.GetBytes(strMessage), 0, strMessage.Length);
encStream.Close();  

byte[] desEncrypted=memStream.GetBuffer();
string strEncrypted=BitConverter.ToString(desEncrypted, 0, i);
		
memStream.Close();


Thanks for any ideas in advance,
Rado


Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll

GeneralRe: Problem with .NET DES encryption Pin
Radoslav Bielik25-Jan-05 23:00
Radoslav Bielik25-Jan-05 23:00 
GeneralDebug Manager Service Pin
mitreviper25-Jan-05 20:18
mitreviper25-Jan-05 20:18 
GeneralControls using DataGrid at Runtime Pin
venkateshsubramaniyam25-Jan-05 20:08
venkateshsubramaniyam25-Jan-05 20:08 
GeneralQuestion of Form Refresh Pin
jzb25-Jan-05 20:07
jzb25-Jan-05 20:07 
GeneralRe: Question of Form Refresh Pin
mav.northwind25-Jan-05 20:32
mav.northwind25-Jan-05 20:32 
GeneralRe: Question of Form Refresh Pin
jzb25-Jan-05 22:42
jzb25-Jan-05 22:42 
GeneralRe: Question of Form Refresh Pin
mav.northwind25-Jan-05 23:05
mav.northwind25-Jan-05 23:05 
GeneralRe: Question of Form Refresh Pin
damphlett26-Jan-05 3:18
damphlett26-Jan-05 3:18 
GeneralDTS (Import/Export) Pin
ye win zaw25-Jan-05 17:13
ye win zaw25-Jan-05 17:13 
General.NET framework version questions... Pin
new_phoenix25-Jan-05 14:21
new_phoenix25-Jan-05 14:21 
GeneralRe: .NET framework version questions... Pin
Nick Parker25-Jan-05 17:27
protectorNick Parker25-Jan-05 17:27 
GeneralRe: .NET framework version questions... Pin
new_phoenix27-Jan-05 5:25
new_phoenix27-Jan-05 5:25 
QuestionCan no longer view Help(CHM) through windows application Pin
Mike Balfour25-Jan-05 13:29
Mike Balfour25-Jan-05 13:29 
GeneralProcedure Parameter Pointer Pin
Budi Zhu25-Jan-05 11:24
Budi Zhu25-Jan-05 11:24 
GeneralRe: Procedure Parameter Pointer Pin
Dennis C. Dietrich25-Jan-05 12:13
Dennis C. Dietrich25-Jan-05 12:13 
GeneralA Design question [offtopic?] Pin
moredip25-Jan-05 11:03
moredip25-Jan-05 11:03 
GeneralRe: A Design question [offtopic?] Pin
Skynyrd25-Jan-05 12:01
Skynyrd25-Jan-05 12:01 

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.