libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit c8715e29e9777f080c79fb4efd0f5d753a0a19d3
parent 57e371e614689d5a479cc197dffd454b1886e56e
Author: Florian Dold <dold@taler.net>
Date:   Wed,  4 Nov 2026 15:31:35 +0100

nexus: truncate exported IBAN hashes to 128 bits

Diffstat:
Mcontrib/export-nexus-withdrawals.sh | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/contrib/export-nexus-withdrawals.sh b/contrib/export-nexus-withdrawals.sh @@ -26,9 +26,10 @@ psql uses its usual PGDATABASE, PGHOST, PGUSER, etc. environment variables. Columns: incoming_transaction_id, execution_time_utc, amount, sender_iban_hash. Amounts use the currency configured for this Nexus instance (not stored in SQL). -The hash is SHA-256(random 32-byte salt || uppercase IBAN). One fresh salt is -used for the entire export, so senders can be grouped within a file but hashes -change between runs. The salt is not included in the CSV or saved by the script. +The hash is SHA-256(random 32-byte salt || uppercase IBAN), truncated to +128 bits (32 hexadecimal characters). One fresh salt is used for the entire +export, so senders can be grouped within a file but hashes change between runs. +The salt is not included in the CSV or saved by the script. Names, payment subjects, and raw payto URIs are not exported. Unsupported/missing IBANs cause an error instead of silently dropping transfers. The output file is replaced only after a successful export, with mode 0600. @@ -104,10 +105,10 @@ COPY ( 'YYYY-MM-DD"T"HH24:MI:SS.US"Z"' ) AS execution_time_utc, (i.amount).val::text || '.' || lpad((i.amount).frac::text, 8, '0') AS amount, - encode(sha256( + left(encode(sha256( decode(:'export_salt', 'hex') || convert_to(upper(substring(i.debit_payto FROM ('(?i)' || :'iban_pattern'))), 'UTF8') - ), 'hex') AS sender_iban_hash + ), 'hex'), 32) AS sender_iban_hash FROM libeufin_nexus.incoming_transactions AS i JOIN libeufin_nexus.talerable_incoming_transactions AS t USING (incoming_transaction_id)