So I've tried using the svyCrypto to encrypt the data, which is easy using the svyCryptoSample. But I run into problems when I try to find an online aes-decryptor that I can use to demonstrate that the encryption is valid.
Here is my encryption code
- Code: Select all
var oCDC = {code="12345678",mail="jan.jansen@example.com",phone="003112345678"}
var algorithm = scopes.svyCrypto.ALGORITHM_NAMES.AES;
var op = scopes.svyCrypto.createOptions();
op.setAlgorithmName(algorithm);
var key = '2lrRKQfHzxACgOG0D1hDDAK3a3b98zfe';
application.output(key);
op.setKey(key);
var cr = scopes.svyCrypto.encrypt(JSON.stringify(oCDC),op)
var val = cr.getValue();
application.output(val);
var res = scopes.svyCrypto.decryptAsString(val,op);
application.output(res)
It seems that svyCrypto uses 192bits keys by default, however, creating a 32chars key should force it to 256bits encryption (it seems to work in the above sample)
But I cannot find an online tool that accepts the encrypted string as input (same when using the default 192bits keys), I have tried the following tools:
https://www.javainuse.com/aesgenerator
https://www.devglan.com/online-tools/ae ... decryption
https://encode-decode.com/aes-256-cbc-encrypt-online/
Any idea's?