[Gambas-user] Usage of openssl.EncryptSalted

Gianluigi gradobag at gradobag.it
Tue May 30 23:14:39 CEST 2023


Il 30/05/23 17:59, Marco Ancillotti ha scritto:
>
> Hi all.
>
> I'm trying to replicate a des3 encryption without shell using only 
> gambas but I get different output.
>
> This is my example code:
>
> #!/usr/bin/env gbs3
>
> USE "gb.openssl"
>
> ' Key
> dim K as string="8aa69be1566a1dff572e102ed7266da674524d78ea8b933a"
> ' Init Vector
> dim IV as string="7eec1ceeaebc9828"
> ' string to encrypt
> dim pwd as string="1234567812345678"
>
> print Cipher["DES3"].EncryptSalted(pwd,K,IV)
>
> shell "printf \"" & pwd &  "\"" &
>      " | openssl des3 -a -nopad " &
>      "-K \"" & K & "\" " &
>      "-iv \"" & IV & "\""
>
> I get the right output from the shell openssl call but I can't 
> replicate with gambas.
>
> What's wrong ?
>
> thank's in advance,
> marco.
>

You can find a lesson on the subject here:

https://gambas-buch.de/doku.php?id=k28:k28.3:start

Regards

Gianluigi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230530/370b2f94/attachment.htm>


More information about the User mailing list