[SOLVED] Cryptography
Author: dammie@seznam.cz (dammie)
Hello, I ve tried encrypting in uniface that i ve founded in documentation help but none of examples is working :( EXAMPLE 1 variables string vEnc raw vrawdata endvariables vEnc = $encode("BLOWFISH", "~home", "secret key") ;encrypt the data vRawData = $decode("BLOWFISH", vEnc, "secret key") ;decrypt the data klic = $encode("USTRING", vRawData) ;convert the decrypted data from Raw to String "ERROR=-1791·; MNEM=<UENCERR_GENERAL>·; DESCRIPTION=Encode/decode general error·; COMPONENT=AA0006XO·; PROCNAME=6\\DTLF·; TRIGGER=DTLF·; LINE=3·; ADDITIONAL=StreamTransformationFilter: ciphertext length is not a multiple of block size" EXAMPLE 2 # Generate the RSA private key in the traditional SSLeay format. openssl genrsa -out traditional.pem 2048 OK # Change the private key to PKCS#8 format in PEM encoding. openssl pkcs8 -topk8 -in traditional.pem -inform pem -out myPrivateKey.pem -outform pem To generate the corresponding public key: OK openssl rsa -in myPrivateKey.pem -out myPublicKey.pem -pubout OK ; Load keys fileload “myPublicKey.pem”, sPubKey ; Encrypt data by RSA-OAEP encryption scheme with SHA-512 hash ciphertext = $encode("RSA_OAEP_SHA512", plaintext, sPubKey) "ERROR=-1784·; MNEM=<UENCERR_INVALID_ALGORITHM>·; DESCRIPTION=Invalid algorithm·; COMPONENT=AA0006XO·; PROCNAME=6\\DTLF·; TRIGGER=DTLF·; LINE=3"