[Gambas-user] Usage of openssl.EncryptSalted

Marco Ancillotti gambas at servinfo.it
Tue May 30 17:59:24 CEST 2023


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.


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


More information about the User mailing list