For Programmers: Free Programming Magazines  


Home > Archive > Java Security > September 2006 > DOTNET Encryption decypted in Java









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author DOTNET Encryption decypted in Java
Tobel

2006-09-04, 8:01 am

Hello

I want to decrypt a DOTNET encypted text with Java, but i do not know
how. The DOTNET function looks like that:

private void but_encrypt_Click(object sender, System.EventArgs e)
{
byte[] clearBytes =
System.Text.Encoding.Unicode.GetBytes(tb_Content.Text);
byte[] pw =
System.Text.Encoding.Unicode.GetBytes(tb_PassPhrase.Text);
byte[] IV = System.Text.Encoding.Unicode.GetBytes(tb_iv.Text);
tb_ShowEncrypted.Text +=
Convert.ToBase64String(crypto.Encrypt(clearBytes, pw, IV));
}

The function need the text to be encrypted, a 16 Byte long password and
a 16 Byte long IV. Then the encrpyted text will be encodec with Base64
an shown.

Thanks and best regards,

Tobias Dreyschultze

Oliver Wong

2006-09-07, 7:04 pm


"Tobel" <tobel@gmx.org> wrote in message
news:1157378644.556744.258440@m73g2000cwd.googlegroups.com...
> Hello
>
> I want to decrypt a DOTNET encypted text with Java, but i do not know
> how. The DOTNET function looks like that:
>
> private void but_encrypt_Click(object sender, System.EventArgs e)
> {
> byte[] clearBytes =
> System.Text.Encoding.Unicode.GetBytes(tb_Content.Text);
> byte[] pw =
> System.Text.Encoding.Unicode.GetBytes(tb_PassPhrase.Text);
> byte[] IV = System.Text.Encoding.Unicode.GetBytes(tb_iv.Text);
> tb_ShowEncrypted.Text +=
> Convert.ToBase64String(crypto.Encrypt(clearBytes, pw, IV));
> }
>
> The function need the text to be encrypted, a 16 Byte long password and
> a 16 Byte long IV. Then the encrpyted text will be encodec with Base64
> an shown.


The important code is in crypto.Encrypt.

- Oliver

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com