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

California regulator places on maintain an order to droop Tesla gross sales | California

A California regulator has placed on maintain an order to droop Tesla gross sales within the state, the most recent growth in a...

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”),...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here