Re: Security.Crypto.. API question
From: Mark Harris (mhazledine@deleteme.learningfast.com)
Date: 10/30/02
- Next message: Fritz Luescher: ""Unable to start debugging on the web server""
- Previous message: Joao.Cardoso: "How to get UserName / NetBios machine name using FORMS authentication"
- In reply to: Shawn Farkas [MS]: "Re: Security.Crypto.. API question"
- Next in thread: Shawn Farkas [MS]: "Re: Security.Crypto.. API question"
- Reply: Shawn Farkas [MS]: "Re: Security.Crypto.. API question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Mark Harris" <mhazledine@deleteme.learningfast.com> Date: Thu, 31 Oct 2002 00:03:48 +1100
Hi Shaun
Thanks for the information however I cant seem to decrypt a string sent to
me from Perl. I would like to know am I doing something wrong. Can someone
please try the following values for me and tell me whether it works?
Monash LearningFast --> Text to encode.
|ìbÜÛ,ÔN¢$ÄÓ·ï -> 3DES Monash LearningFast
fOwcYpHc2yydoJEH1E4bQ6IkmcTTt5Tv -> 3DES base64 encoded
Any Help will be greatly appreciated
public string Decrypting(string Source, string Key)
{
// convert from Base64 to binary
byte[] bytIn = System.Convert.FromBase64String(Source);
// create a MemoryStream with the input
System.IO.MemoryStream ms = new System.IO.MemoryStream(bytIn, 0,
bytIn.Length);
byte[] bytKey = GetLegalKey(Key);
// set the private key
mobjCryptoService.Key = bytKey;
mobjCryptoService.Mode = CipherMode.ECB;
//mobjCryptoService.
//mobjCryptoService.IV = mobjCryptoService.GenerateIV();
// create a Decryptor from the Provider Service instance
ICryptoTransform encrypto = mobjCryptoService.CreateDecryptor();
// create Crypto Stream that transforms a stream using the decryption
CryptoStream cs = new CryptoStream(ms, encrypto, CryptoStreamMode.Read);
// read out the result from the Crypto Stream
System.IO.StreamReader sr = new System.IO.StreamReader( cs );
return sr.ReadToEnd();
}
"Shawn Farkas [MS]" <shawnfa@online.microsoft.com> wrote in message
news:OR4vpA6fCHA.1736@tkmsftngp11...
> Hi Mark,
>
> When you create your TripleDES object, set the Mode property to be
> CipherMode.ECB. Then you can ignore the IV and decode the Perl output.
>
> -Shawn
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Please do not send email directly to this alias, this alias is for
newsgroup
> purposes only.
>
>
> "Mark Harris" <mhazledine@deleteme.learningfast.com> wrote in message
> news:OLjfigzfCHA.2664@tkmsftngp11...
> Hi all,
>
> I have a small problem with regards to some encryption.
>
> I am receiving a encrypted message from a Perl the info about the
> encryption is below.
>
>
http://search.cpan.org/author/VIPUL/Crypt-TripleDES-0.24/lib/Crypt/TripleDES
> .pm
>
> I am then trying to use the CryptoAPI to decrypt it. Unfortunately there
is
> something know as a IV which I have not used in the Perl version. My
> Question is. Is it possible to decrypt this information from perl via the
> .net framework
>
> The Algorithm I am trying to use is 3DES as the purl link indicates
>
> Any help will be appreciated.
>
> Cheers
> Mark
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.408 / Virus Database: 230 - Release Date: 24/10/2002
>
>
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.408 / Virus Database: 230 - Release Date: 24/10/2002
- Next message: Fritz Luescher: ""Unable to start debugging on the web server""
- Previous message: Joao.Cardoso: "How to get UserName / NetBios machine name using FORMS authentication"
- In reply to: Shawn Farkas [MS]: "Re: Security.Crypto.. API question"
- Next in thread: Shawn Farkas [MS]: "Re: Security.Crypto.. API question"
- Reply: Shawn Farkas [MS]: "Re: Security.Crypto.. API question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|