[Info-ingres] decrypt of encrypted integers failes with E_US100F
Martin Bowes
martin.bowes at ndph.ox.ac.uk
Mon Apr 4 10:59:41 UTC 2016
The problem can be simplified to a cast issue...
select cast(cast(1 as byte(4)) as integer4)
E_US100F String cannot be converted to numeric due to incorrect syntax.
(Mon Apr 4 11:58:18 2016)
select cast(cast(1 as boolean), integer4)
┌─────────────┐
│col1 │
├─────────────┤
│ 1│
└─────────────┘
(1 row)
From: Martin Bowes
Sent: 04 April 2016 11:04
To: info-ingres at lists.planetingres.org
Subject: decrypt of encrypted integers failes with E_US100F
Hi All,
This works:
select aes_decrypt(aes_encrypt('tom, dick and harry!', 'FUNNY'), 'FUNNY');
The string is easily converted into a varbyte() encrypted and then decrypted.
This doesn't work:
select cast(aes_decrypt(aes_encrypt(cast(1 as byte(4)), 'FUNNY') , 'FUNNY') as integer4);
Now I thought I'd handled the conversion in aes_encrypt() of the integer into a varbyte. I was pretty sure the output (varbyte) from aes_decrypt being wrapped in a cast to integer4 should have been cool.
But it fails with: E_US100F String cannot be converted to numeric due to incorrect syntax.
What have I done wrong?
Martin Bowes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.planetingres.org/pipermail/info-ingres/attachments/20160404/7a65f61f/attachment.html>
More information about the Info-ingres
mailing list