Skip to content

Instantly share code, notes, and snippets.

@mgax
Created May 10, 2016 14:49
Show Gist options
  • Save mgax/16aca799541eaed641f1241f6526cbbf to your computer and use it in GitHub Desktop.
Save mgax/16aca799541eaed641f1241f6526cbbf to your computer and use it in GitHub Desktop.
\o /dev/null
\timing
\echo '\npgp:'
select pgp_sym_decrypt(pgp_sym_encrypt('n≃'||n, 'fff'), 'fff') FROM generate_series(1, 10000) as n;
--- Time: 18368.963 ms
\echo '\nencrypt_iv:'
select convert_from(decrypt_iv(encrypt_iv(convert_to('n≃'||n, 'UTF8'), 'fff', 'iviviv', 'aes'), 'fff', 'iviviv', 'aes'), 'UTF8') FROM generate_series(1, 10000) as n;
--- Time: 37.718 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment