Hello!
I try to build a subrouting that will be used by an I-DESC. Its goal is to encrypt another attribute, using SHA256. The DICT item will be used in CSV exports, to transmit data to partners. They want some columns to be encrypted (it would be too easy to encrypt the whole file I guess). That is why I want to combine a subroutine with an I-DESC.
Okay, so I already wrote my subroutine but I am not sure about the result. Maybe someone here already did something similar, and/or maybe someone could help me to find the right way to reach my goal.
My subroutine is simple: I use DIGEST (beacuse it was the only function that seems to know pure SHA256), and after, I encode the result as BASE64-OneLine, to make it human-readable.
MY.HASH = "SHA256"
MY.STRING = "HELLO"
DIGEST.STATUS = DIGEST(MY.HASH, MY.STRING, 1, MY.DIGEST)
FINAL.STRING = ""
ENCODE.STATUS = ENCODE("BASE64A", 1, MY.DIGEST, 1, FINAL.STRING, 1)
The result of the subroutine, for string HELLO, is L/qIdUmp4FD73SZttIGW+w==
It looks like something encrypted, it's a good sign! I want to compare my result with online tools, so I went on
SHA256 Online (emn178.github.io) and entered
HELLO in the input box. The result is
3733cd977ff8eb18b987357e22ced99f46097f31ecb239e878ae63760e83e4d5.
I believe I did someting wrong, but now, I don't have any clues.
I also tried the ENCRYPT() function. Buy the fact that I don't use an Encryption Key breaks the logic a little.
I hope someone could give me some hints! Thank you very much all!
#UniVerse #11.3.1 #Pick #BASIC