031 | DApps Building Blocks

0
51

Mechanism for 『message encryption/decryption』by public/private key pair with Javascript

Wondering how to communicate with a person secretly on the public ledge by using public and private key?

Receiver's public key:
fff49b58b83104ff16875452852466a46c7169ba4e368d11830c9170624e0a9509080a05a38c18841718ea4fc13483ac467d3e2d728d41ff16b73b9c943734f8
Message to receiver:
DEXON's latency is 1s
Encrypted string with receiver's public key
64023e652b794bdb8e2439a6967082c8021fa8e5391ab6bf508fb5e1f5ad6ef956c2b35b08387f18c30b34e4efa438577cc5389975c09648d17664fb2d3772c3de2f31ce5616232ed64f389e6dd9519da4ddef6df3823bb7c2bbad11524a02c47515106d9791a50adaf969dbd8615974db
decrypted-encrypted-string message with receiver's private key
DEXON's latency is 1s

If you are building DApps on any of the platform listed below, the knowledge could be shared. 
1. DEXON
2. ethereum
3. TRON Foundation

Source