Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: no e2e encrypted messaging support #1406

Closed
5 tasks done
yihuang opened this issue Apr 26, 2024 · 4 comments
Closed
5 tasks done

Problem: no e2e encrypted messaging support #1406

yihuang opened this issue Apr 26, 2024 · 4 comments
Assignees

Comments

@yihuang
Copy link
Collaborator

yihuang commented Apr 26, 2024

add commands for users to generate a separate keypair for asymmetric encryption, the pubkey is published to on-chain state for encryption, private key is saved in local keyring for decryption.

Libraries/Tools

We need something that can be used programmatically in golang.

  • age seems to be a well-maintained library and tool for asymmetric encryption.

New Commands

  • cronosd gen-encryption-key [name]
    This command will generate a new key for age encryption, the private key is saved in the keyring, and the public key is outputted.
  • cronosd set-encryption-key [pub-key] --from user-address
    The tx should be signed by the user, and the encryption key is stored associated with the user address.
  • cronosd encrypt [recipients] [message]
    This command will load the associated encryption keys for one or many recipients, and encrypt the message to all of them.

User Flow

  1. User generates a new keypair locally using age-keygen:

    $ age-keygen -o privatekey.txt
    Public key: [PUBLIC KEY]
    
  2. User can publish a [PUBLIC KEY] to chain:

    $ cronosd set-encryption-key [PUBLIC KEY]
    
  3. User save the private key in the keyring:

    $ cronosd keyring-add-raw "encryptionkey" "$(cat privatekey.txt)"
    
  4. Third party then can encrypt private messages to multiple users:

    $ cronosd encrypt [recipients] [MESSAGE]
    

    The encrypted message can be published anywhere, depending on the application.

Tracking

@mmsqe
Copy link
Collaborator

mmsqe commented Apr 26, 2024

I tried EncryptAndDecrypt with btcd seems work with secp256k1

@yihuang
Copy link
Collaborator Author

yihuang commented Apr 26, 2024

I tried EncryptAndDecrypt with btcd seems work with secp256k1

define "work" ;D

@mmsqe
Copy link
Collaborator

mmsqe commented Apr 26, 2024

I tried EncryptAndDecrypt with btcd seems work with secp256k1

define "work" ;D

do we need support multi recipients here

@yihuang
Copy link
Collaborator Author

yihuang commented Apr 26, 2024

I tried EncryptAndDecrypt with btcd seems work with secp256k1

define "work" ;D

do we need support multi recipients here

yes

@yihuang yihuang changed the title Problem: no encryption keys for validators Problem: no asymmetric encryption support Apr 26, 2024
@yihuang yihuang changed the title Problem: no asymmetric encryption support Problem: no e2e encrypted messaging support Apr 26, 2024
@yihuang yihuang closed this as completed Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants