From 223619587a56d665d836c0889c175f6b3f554815 Mon Sep 17 00:00:00 2001 From: librelois <c@elo.tf> Date: Sat, 22 May 2021 23:07:22 +0200 Subject: [PATCH] [RFC17] add regex to quickly recognize if a comment fits this format --- rfc/0017_transaction_comment_encryption.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rfc/0017_transaction_comment_encryption.md b/rfc/0017_transaction_comment_encryption.md index 574e923..5864db3 100644 --- a/rfc/0017_transaction_comment_encryption.md +++ b/rfc/0017_transaction_comment_encryption.md @@ -23,7 +23,7 @@ Use NaCl function `crypto_sign_ed25519_pk_to_curve25519`. Let `Pr' = crypto_sign_ed25519_pk_to_curve25519(Pr)` -## Generate symetric encryption key +## Generate symmetric encryption key We use nacl function [crypto_box_beforenm]. Then use scrypt with a random nonce. @@ -46,7 +46,6 @@ With following parameters for scrypt: |**p** | 1 | |**dkLen** | message length | - ## Encrypt with XOR cipher Encrypt bit per bit with XOR cipher. @@ -112,6 +111,10 @@ The DUBP protocol allows up to 255 characters in the comment field, so it is pos There are at least 21 bytes of metadata, so the maximum size of a message is **170 bytes**. +## Quickly recognize if a comment fits this format + +You can quickly recognize if a comment fits this format with the following regex: `J7YB[0-9a-zA-Z+/]{24,}` + ## Encrypt transaction comment (Issuer side) Let `m` the user message bytes encoded in UTF8. -- GitLab