https://github.com/aleph-im/signature-based-encryption
A simple proof of concept of generating an AES CryptoKey using an EIP-712 signed payload
https://github.com/aleph-im/signature-based-encryption
cryptography encryption ethereum
Last synced: 2 months ago
JSON representation
A simple proof of concept of generating an AES CryptoKey using an EIP-712 signed payload
- Host: GitHub
- URL: https://github.com/aleph-im/signature-based-encryption
- Owner: aleph-im
- Created: 2023-08-18T12:36:03.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-18T12:48:18.000Z (almost 3 years ago)
- Last Synced: 2024-03-29T11:57:32.349Z (about 2 years ago)
- Topics: cryptography, encryption, ethereum
- Language: TypeScript
- Homepage: https://bjrint.github.io/signature-based-encryption/
- Size: 118 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Signature Based Encryption
This repository is a simple proof of concept of generating an AES CryptoKey using an EIP-712 signed payload, to encrypt data without having to store the privateKey.
The underlying idea is that ECDSA signatures are deterministic but unpredictable making it a convenient way to generate key.
## Workflow
- "Log in" using Metamask or any other compatible wallet
- Press the Generate Encryption Keypair button. This will sign a defined constant payload (set in [./src/helpers.ts](helpers.ts)).
- The signed Buffer will then be hashed, using sha-256, generating a 256-bit digest.
- The sha-256 digest is used as a raw input AES private key.
- You can now encrypt/decrypt using your key
It is easy to further build upon that project to export the associated publicKey and use it as a generic file encryptor.
## Disclaimer
**This project is provided as is, without any warranty or security liability. Use it at your own risk.**