diff --git a/4dev/tests/DB/CoreLibsDBIOTest.php b/4dev/tests/DB/CoreLibsDBIOTest.php
index 4ed9cabd..f9e66c6a 100644
--- a/4dev/tests/DB/CoreLibsDBIOTest.php
+++ b/4dev/tests/DB/CoreLibsDBIOTest.php
@@ -5009,8 +5009,8 @@ final class CoreLibsDBIOTest extends TestCase
)
),
($params === null ?
- $db->dbGetQueryHash($query) :
- $db->dbGetQueryHash($query, $params)
+ $db->dbBuildQueryHash($query) :
+ $db->dbBuildQueryHash($query, $params)
),
'Failed assertdbGetQueryHash '
);
diff --git a/www/admin/class_test.db.encryption.php b/www/admin/class_test.db.encryption.php
index 7a0a827d..0d8da1cb 100644
--- a/www/admin/class_test.db.encryption.php
+++ b/www/admin/class_test.db.encryption.php
@@ -42,7 +42,10 @@ print '
';
print '' . $PAGE_NAME . '
';
// encryption key
-$key = CreateKey::generateRandomKey();
+$key_new = CreateKey::generateRandomKey();
+print "Secret Key NEW: " . $key_new . "
";
+// for reproducable test results
+$key = 'e475c19b9a3c8363feb06b51f5b73f1dc9b6f20757d4ab89509bf5cc70ed30ec';
print "Secret Key: " . $key . "
";
// test text
@@ -105,20 +108,35 @@ $res = $db->dbReturnRowParams(
-- in DB encryption
pg_digest_bytea, pg_digest_text,
pg_hmac_bytea, pg_hmac_text,
- pg_crypt_bytea, pg_crypt_text
+ pg_crypt_bytea, pg_crypt_text,
+ encode(pg_crypt_bytea, 'hex') AS pg_crypt_bytea_hex,
+ pgp_sym_decrypt(pg_crypt_bytea, $2) AS from_pg_crypt_bytea,
+ pgp_sym_decrypt(decode(pg_crypt_text, 'hex'), $2) AS from_pg_crypt_text
FROM
test_encryption
WHERE
cuuid = $1
SQL,
[
- $cuuid
+ $cuuid, $key
]
);
print "RES: " . Support::prAr($res) . "
";
-// do compare
+if ($res === false) {
+ echo "Failed to run query
";
+} else {
+ if (hash_equals($string_hashed, $res['pg_digest_text'])) {
+ print "libsodium and pgcrypto hash match
";
+ }
+ if (hash_equals($string_hmac, $res['pg_hmac_text'])) {
+ print "libsodium and pgcrypto hash hmac match
";
+ }
+}
+
+
+// do compare for PHP and pgcrypto settings
print "