[Lazarus] Encryption compatible with .net

Sven Barth pascaldragon at googlemail.com
Sun Nov 15 11:59:27 CET 2015


Am 15.11.2015 06:31 schrieb "Gabriele Cappelletto" <
cappellettogabriele at yahoo.it>:
>
>
>
> Il 14/11/2015 18:11, Graeme Geldenhuys ha scritto:
> > On 2015-11-14 09:44, Gabriele Cappelletto wrote:
> >> the .net DESCryptoServiceProvider.
> > Please show how the data was encrypted... The exact code snippet would
> > be useful. I could then show you how to use DCPCrypt with the same
> > settings to decrypt it.
> >
> > Without knowing how it was encrypted, there is no way anybody can show
> > you code on how to decrypt it.
> >
> > Regards,
> >   - Graeme -
> > Ok thanks. We start from the opposite. cryptographer a string with
vb.net with the following code, what's the code to decrypt it with DCPCrypt?
>
> Ok thanks. We start from the opposite. cryptographer a string with
> vb.net with the following code, what's the code to decrypt it with
DCPCrypt?
>
>         Dim Key() As Byte = {}
>         Dim IV() As Byte = {1, 2, 3, 4, 5, 6, 7, 8}
>
>         Dim KeyStr As String = "cicciob1"
>         Dim vector As String = "12345678"
>         Dim inputByteArray(TextBox3.Text.Length) As Byte
>         Dim des As New DESCryptoServiceProvider
>         'des.Mode = CipherMode.CBC
>         'des.Padding = PaddingMode.Zeros
>         Key = System.Text.Encoding.UTF8.GetBytes(KeyStr)
>         inputByteArray = Encoding.UTF8.GetBytes(TextBox3.Text)
>
>         Dim ms As New MemoryStream
>         Dim cs As New CryptoStream(ms, des.CreateEncryptor(Key, IV),
> CryptoStreamMode.Write)
>         cs.Write(inputByteArray, 0, inputByteArray.Length)
>         cs.FlushFinalBlock()
>
>         TextBox4.Text = Convert.ToBase64String(ms.ToArray)

What did you try in the Pascal side (code please)? Did you decode the
Base64 stream before passing the data to the decryption?

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20151115/b8d872d8/attachment-0003.html>


More information about the Lazarus mailing list