Re: DES and UUEncoded

From: Alain Hogue (alain_at_aza.qc.ca)
Date: 04/01/04

  • Next message: Jonathan Ruckert: "RE: How to retrieve "Security EventLog" from Win32_NTLogEvent"
    Date: Wed, 31 Mar 2004 20:55:48 -0500
    
    

    Thanks for the info!

    I already tried that, but the problem I have is the DES.EXE program I am
    using only use a key and not an IV. o I donbt know what to use for an IV?
    Anything I put in there does not work with that external program.

    Alain

    ""Shawn Farkas"" <shawnfa@online.microsoft.com> a écrit dans le message de
    news:gNi43mfFEHA.3096@cpmsftngxa06.phx.gbl...
    > Hi Alain,
    >
    > There's no built in support for uudecoding (although if you search google,
    I'm sure you'll either find some sample code, or a description of
    > the algorithm which wouldn't be difficult to implement yourself). Once
    you've decoded it, using DES encryption is easy. First, you'll need to add
    the
    > System.Security.Cryptography namespace to the namespaces your code
    references. Once you've done that, you can create an instance of the
    > DESCryptoServiceProvider class, and setup your key and IV. CBC is the
    default mode of the DESCryptoServiceProvider, so you won't need to
    > change that.
    > Next you create a MemoryStream that will hold the output of your
    decryption. This is a oneliner:
    >
    > MemoryStream ms = new MemoryStream();
    >
    > Then you hook up a CryptoStream to that memory stream, and set it to
    decrypt mode:
    >
    > CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(),
    CryptoStreamMode.Write);
    >
    > After this, you write your encrypted data into the crypto stream. Once
    you've finished writing the last bit of data, close the stream. Your
    > decrypted output will be avaliable in the memory stream. The easiest way
    to get at it is:
    >
    > byte[] decrypted = ms.ToArray();
    >
    > That should be enough to get you started, but if you need more help feel
    free to post back here.
    >
    > -Shawn
    > http://blogs.msdn.com/shawnfa
    >
    > --
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    rights.
    > Note: For the benefit of the community-at-large, all responses to this
    message are best directed to the newsgroup/thread from which they
    > originated.
    > --------------------
    > >From: "Alain Hogue" <alain@aza.qc.ca>
    > >Subject: DES and UUEncoded
    > >Date: Sun, 28 Mar 2004 04:43:46 -0500
    > >Lines: 16
    > >X-Priority: 3
    > >X-MSMail-Priority: Normal
    > >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    > >X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    > >Message-ID: <uArwqkKFEHA.2308@tk2msftngp13.phx.gbl>
    > >Newsgroups: microsoft.public.dotnet.security
    > >NNTP-Posting-Host: dns1.aza.qc.ca 199.243.87.251
    > >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
    > >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.security:5567
    > >X-Tomcat-NG: microsoft.public.dotnet.security
    > >
    > >Hi !
    > >
    > >I am receiving files from a third party (Bloomberg) and the file is
    > >encrypted using DES with cbc mode and then uuencoded.
    > >
    > >How can I uudecode the file AND decrypt it in dotNET using VB Net (or C#)
    ?
    > >I am a beginner in the cryptography field, so some examples would be
    > >great!...
    > >
    > >Thanks alot for your help
    > >
    > >Alain H
    > >
    > >
    > >
    > >
    > >
    >
    >


  • Next message: Jonathan Ruckert: "RE: How to retrieve "Security EventLog" from Win32_NTLogEvent"

    Relevant Pages

    • Re: Cant seem to figure out using cryptography classes
      ... But I can't get decryption working. ... the MemoryStream used for encryption code in my original post. ... CryptoStream cryptoStream = new CryptoStream(memoryStream, ... This assumes that you are using the default CBC mode and not CTR mode. ...
      (microsoft.public.dotnet.languages.csharp)
    • Error during decryption with SymmetricAlgorithm
      ... Encryption and decryption works fine when I work with files, ... Dim bKey As Byte= System.Text.Encoding.UTF8.GetBytes("some ... Dim cStream As CryptoStream = New CryptoStream(ms, ...
      (microsoft.public.dotnet.framework.compactframework)
    • Re: RijndaelManaged and Rijndael CryptoTransforms do not support CFB or OFB CrytoModes
      ... > transform instance the same IV will be used to start off on the first ... In CFB mode, it is *vital* that you rotate IVs as often as possible. ... can induce plain text data into your encryption process himself. ... > message to its respective CryptoStream I will call FlushFinalBlock. ...
      (microsoft.public.dotnet.security)
    • Re: Encrypt a string to a string and vice versa
      ... fine (at least I don't get an exception anywhere, if the string is ... correctly encryption is left aside). ... where I'm just creating a MemoryStream by ... The problem is, as soon as I call ReadByte on the CryptoStream, I get the ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Rijndael decryption succeeds SOMETIMES
      ... Here is another thing concerning your use of 256 bit AES key. ... And if you talk about decryption operation - one decryption operation is ... > Sometimes you can give it a passphrase and the decryption of the encrypted ... > CryptoStream cryptoStream = new CryptoStream(cipherStream, decryptor, ...
      (microsoft.public.dotnet.security)