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

Confirmed, Not Promised: Incomes Our Place on the Street

At Torc, security isn’t only a precedence; it’s the muse that helps each facet of how we develop, deploy, and function our autonomous...

Daimler Truck and Torc Robotics Choose Innoviz Applied sciences as LiDAR Associate for Collection Manufacturing of Stage 4 Autonomous Vehicles

TEL AVIV, Israel: PORTLAND, Ore. and BLACKSBURG, Va. – December 2, 2025 – Innoviz Applied sciences Ltd. (NASDAQ: INVZ) (the “Firm” or “Innoviz”),...

Amazon launches robotaxi service in San Francisco in problem to Google’s Waymo | San Francisco

Amazon’s Zoox is launching its robotaxi service in San Francisco, providing free rides by way of elements of the town because it accelerates...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here