Bitcoin Forum
November 02, 2024, 06:32:30 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Encrypted Messaging with Bitcoin  (Read 773 times)
Jpja (OP)
Member
**
Offline Offline

Activity: 150
Merit: 29

Happy mother of 5 children


View Profile
February 25, 2016, 03:46:43 PM
Merited by ABCbits (1)
 #1

If I do not know the private key of address 1abcd.... is it possible for me to encrypt a message so that only the holder of the private key is able to decrypt the message?

👉🏼 Relictum Pro – touch the future now!
https://relictum.pro/
pedrog
Legendary
*
Offline Offline

Activity: 2786
Merit: 1031



View Profile
February 25, 2016, 03:52:01 PM
 #2

Yes, it is, that's how public-key cryptography works:

https://en.wikipedia.org/wiki/Public-key_cryptography

DannyHamilton
Legendary
*
Offline Offline

Activity: 3472
Merit: 4801



View Profile
February 25, 2016, 05:54:38 PM
 #3

If I do not know the private key of address 1abcd.... is it possible for me to encrypt a message so that only the holder of the private key is able to decrypt the message?

Only if you know the public key.

It would make much more sense to use a cryptographic system that was designed for such a purpose though.
Jpja (OP)
Member
**
Offline Offline

Activity: 150
Merit: 29

Happy mother of 5 children


View Profile
February 26, 2016, 07:34:47 AM
Last edit: February 26, 2016, 07:54:45 AM by Jpja
 #4

The public key is not the same as the address, right? And an address' public key is only known after it has been sent from?

Why it makes sense ... imagine you want to contact the owner of an address. With messaging built into wallets, this will be possible. More specifically, I'm the developer of CounterTools, a Bitcoin wallet with Counterparty functionality. Occasionally people want to contact the owner of an asset.

I'll emphasis that messaging better be off-chain. It's faster and saves fees.

👉🏼 Relictum Pro – touch the future now!
https://relictum.pro/
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1086


Ian Knowles - CIYAM Lead Developer


View Profile WWW
February 26, 2016, 08:04:01 AM
 #5

Assuming you do have the public key of the user you are going to send the message to then you can use the following: https://github.com/ciyam/ciyam/blob/master/src/crypto_keys.cpp#L550 in order to get a "shared secret".

This "shared secret" is what you'd then use to do your message encryption (using AES256 or similar) although you might also want to add salt.

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
kushti
Full Member
***
Offline Offline

Activity: 317
Merit: 103


View Profile WWW
February 26, 2016, 08:29:55 AM
 #6

Ciyam is right, do secp256k1-based ECDH then AES

Ergo Platform core dev. Previously IOHK Research / Nxt core dev / SmartContract.com cofounder.
AliceWonderMiscreations
Full Member
***
Offline Offline

Activity: 182
Merit: 107


View Profile WWW
February 27, 2016, 11:57:08 AM
 #7

Okay this is basic but am I correct in assuming that once you spend an input, the public key for the associated address is exposed?

I'm assuming that is the case, always have assumed that was the case, but...

I hereby reserve the right to sometimes be wrong
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1086


Ian Knowles - CIYAM Lead Developer


View Profile WWW
February 27, 2016, 12:10:28 PM
Merited by ABCbits (2)
 #8

Okay this is basic but am I correct in assuming that once you spend an input, the public key for the associated address is exposed?

Assuming it is a normal P2PKH tx then yes - the public key (and a valid signature) are provided in order to spend the UTXO (so assuming you know that user X owned UTXO Y and has spent it then you would know a public key for that user and could construct a message to send to them noting that in order for them to decode that message they would also need the public key for the private key you used to create the ECDH shared secret).

Of course the message format that you might choose would probably include both public keys to make it easier for the recipient.

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!