I´m using the "crypt32.dll" with appeon 2016 WEB
and it works perfect
Local External Functions:
FUNCTION boolean CryptBinaryToString ( &
Blob pbBinary, &
ulong cbBinary, &
ulong dwFlags, &
Ref string pszString, &
Ref ulong pcchString ) &
LIBRARY "crypt32.dll" ALIAS FOR "CryptBinaryToStringA;Ansi"
FUNCTION boolean CryptStringToBinary ( &
string pszString, &
ulong cchString, &
ulong dwFlags, &
Ref blob pbBinary, &
Ref ulong pcbBinary, &
Ref ulong pdwSkip, &
Ref ulong pdwFlags ) &
LIBRARY "crypt32.dll" ALIAS FOR "CryptStringToBinaryA;Ansi"
FUNCTION long GetComputerNameW &
(ref string ComputerName, ref ulong BufferLength) &
LIBRARY "KERNEL32.DLL"
FUNCTION long GetUserNameW(ref string UserName, ref ulong BufferLength) &
LIBRARY "ADVAPI32.DLL"
instance Variables
// Base64, with certificate beginning and ending headers
CONSTANT Ulong CRYPT_STRING_BASE64HEADER = 0
// Base64, without headers
CONSTANT Ulong CRYPT_STRING_BASE64 = 1
// Pure binary copy
CONSTANT Ulong CRYPT_STRING_BINARY = 2
// Base64, with request beginning and ending headers
CONSTANT Ulong CRYPT_STRING_BASE64REQUESTHEADER = 3
// Hexadecimal only
CONSTANT Ulong CRYPT_STRING_HEX = 4
// Hexadecimal, with ASCII character display
CONSTANT Ulong CRYPT_STRING_HEXASCII = 5
// Base64, with X.509 CRL beginning and ending headers
CONSTANT Ulong CRYPT_STRING_BASE64X509CRLHEADER = 9
// Hexadecimal, with address display
CONSTANT Ulong CRYPT_STRING_HEXADDR = 10
// Hexadecimal, with ASCII character and address display
CONSTANT Ulong CRYPT_STRING_HEXASCIIADDR = 11
// A raw hex string. WinServer 2K3, WinXP: This value is not supported.
CONSTANT Ulong CRYPT_STRING_HEXRAW = 12
I've gone through the same trouble. Would your simple encryption/decryption mechanism need any modifications for them to work on powerserver web?
regards,
Miguel
No .. the "simple" encryption mechanism is all coded in pure native PowerScript and works on both the PS Web and Mobile applications. Note that in my framework, the "simple" encryption and decryption feature is implemented via the "fn_decrypt_simple" and "fn_encrypt_simple" global functions. So you could just copy these functions from my framework over to your App(s) & use them "as is". ;-)
Also, I have a complete framework encryption / decryption example as well if you would like to review that code now or in the future: https://sourceforge.net/projects/stdfndclass/files/Applications/PowerBuilder/Cryptography
Regards ... Chris