View Single Post
Old 11th June 2018, 18:52   #3
otrub
Junior Member
 
Join Date: Mar 2018
Posts: 8
code:
InitPluginsDir ;make sure we have $pluginsdir
File "/ONAME=$pluginsdir\NsisCrypt.dll" "${NSISDIR}\Plugins\x86-ansi\NsisCrypt.dll" ;you must extract the Ansi plugin manually

;StrCpy $1 "ascii"
CallAnsiPlugin::Call "$pluginsdir\NsisCrypt" Hash 2 "123" "md5"
Pop $2
DetailPrint "Hash(123) = $2"

CallAnsiPlugin::Call "$pluginsdir\NsisCrypt" Hash 2 "456" "md5"
Pop $3
DetailPrint "Hash(456) = $3"

;StrCpy $1 "ascii"
CallAnsiPlugin::Call "$pluginsdir\NsisCrypt" EncryptSymmetric 4 "test string" "aes128" "$2" "$3"
Pop $1
DetailPrint "EncryptSymmetric = $1"



Im newbie in encryption and nsis. Therefore I tried and this code:

code:
InitPluginsDir ;make sure we have $pluginsdir
File "/ONAME=$pluginsdir\NsisCrypt.dll" "${NSISDIR}\Plugins\x86-ansi\NsisCrypt.dll" ;you must extract the Ansi plugin manually

;StrCpy $1 "ascii"
CallAnsiPlugin::Call "$pluginsdir\NsisCrypt" Hash 2 "123" "md5"
Pop $2
DetailPrint "Hash(123) = $2"

CallAnsiPlugin::Call "$pluginsdir\NsisCrypt" Hash 2 "456" "md5"
Pop $3
DetailPrint "Hash(456) = $3"

CallAnsiPlugin::Call "$pluginsdir\NsisCrypt" Base64Encode 1 "$2"
Pop $4
DetailPrint "Base64Encode(Hash(123)) = $4"

CallAnsiPlugin::Call "$pluginsdir\NsisCrypt" Base64Encode 1 "$3"
Pop $5
DetailPrint "Base64Encode(Hash(456)) = $5"

;StrCpy $1 "ascii"
CallAnsiPlugin::Call "$pluginsdir\NsisCrypt" EncryptSymmetric 4 "test string" "aes128" "$4" "$5"
Pop $1
DetailPrint "EncryptSymmetric = $1"



And just in case tried this one:

code:
InitPluginsDir ;make sure we have $pluginsdir
File "/ONAME=$pluginsdir\NsisCrypt.dll" "${NSISDIR}\Plugins\x86-ansi\NsisCrypt.dll" ;you must extract the Ansi plugin manually

CallAnsiPlugin::Call "$pluginsdir\NsisCrypt" Base64Encode 1 "123"
Pop $4
DetailPrint "Base64Encode(Hash(123)) = $4"

CallAnsiPlugin::Call "$pluginsdir\NsisCrypt" Base64Encode 1 "456"
Pop $5
DetailPrint "Base64Encode(Hash(456)) = $5"

;StrCpy $1 "ascii"
CallAnsiPlugin::Call "$pluginsdir\NsisCrypt" EncryptSymmetric 4 "test string" "aes128" "$4" "$5"
Pop $1
DetailPrint "EncryptSymmetric = $1"



And all trys has one result with error message. I use callansi plugin as opposed to normal way after I visited many forums and only one site told me how to solve other error with unknown chinese words.

With option ascii I had another results of functions but with no victory.
otrub is offline   Reply With Quote