Re: Security.Crypto.. API question

From: Mark Harris (mhazledine@deleteme.learningfast.com)
Date: 10/30/02


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


Relevant Pages

  • Bad Data using TripleDES Encryption
    ... For example, when looping from 0 to 100, I encrypt and decrypt the values. ... public static string EncryptString(string toEncrypt) ... bytebytKey = GetLegalKey; ... CryptoStream cs = new CryptoStream(ms, encrypto, CryptoStreamMode.Write); ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: storing a username and password
    ... decrypt the decrypt the password it throws the following exception: ... public static string Decrypting ... CryptoStream cs = new CryptoStream(ms, encrypto, CryptoStreamMode.Read); ...
    (microsoft.public.dotnet.security)
  • decrypt challenge - perl encrypt with ruby decrypt
    ... that is triple des encrypted thru perl. ... I need to decrypt the string thru ruby. ...
    (comp.lang.ruby)
  • Cant Compiling perl5.8.8 on FreeBSD6.2
    ... WITH_DEBUGGING=yes Build perl with debugging support. ... First let's make sure your kit is complete. ... What is the file extension used for shared libraries? ... I'll use sprintf to convert floats into a string. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: Byte array to string and back - newbie question
    ... // Create a symmetric algorithm. ... This is done to make encryption more ... // Encrypt a string into a string using a password ... // Decrypt a byte array into a byte array using a key and an IV ...
    (microsoft.public.dotnet.framework.aspnet.security)