cryptography – Tips on how to encrypt messages with Pub/Priv keys

on

|

views

and

comments


I am questioning if it is attainable to make use of the Bitcoin private and non-private keys (normally used for signing) for textual content encryption. That is an instance in nodeJs:

import pkg from 'bitcore-lib'

const { PrivateKey, Networks } = pkg
const privateKey = new PrivateKey(Networks['livenet'])
const myObject = {
    privateKey: privateKey,
    P2PKHAddress: privateKey.toAddress(),
    publicKey: privateKey.toPublicKey(),
    wif: privateKey.toWIF()
}

It’s attainable to make use of publicKey to encrypt a message and decrypt with privateKey?

const encryptedText = encrypt('Hiya', publicKey)
const decryptedText = decrypt(encryptedText, privateKey)

assert decryptedText === 'Hiya'

Share this
Tags

Must-read

Torc’s Mission Intersects With Occasion Traits of Bodily, Multi-Modal AI, Deployable Methods

Advancing the Way forward for Autonomous Driving CVPR 2026 marked its largest version so far, bringing collectively greater than 10,000 attendees and setting a...

Torc Robotics Broadcasts First-Ever Autonomous-Trucking Partnership at Mila to Advance Bodily AI

Montréal, QC and Blacksburg, VA, Could 26, 2026 — Torc Robotics, a pioneer in self-driving car expertise, right this moment introduced a brand...

Two Torc Vans Are Higher Than One

“We're the one ones that really run on production-intent {hardware} and software program. That’s wanted for scale… at low price, prime quality and...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here