Bitcoin Forum
November 17, 2017, 05:28:13 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Encrypted Messaging with Bitcoin  (Read 591 times)
Jpja
Member
**
Offline Offline

Activity: 88


View Profile
February 25, 2016, 03:46:43 PM
 #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?
1510939693
Hero Member
*
Offline Offline

Posts: 1510939693

View Profile Personal Message (Offline)

Ignore
1510939693
Reply with quote  #2

1510939693
Report to moderator
1510939693
Hero Member
*
Offline Offline

Posts: 1510939693

View Profile Personal Message (Offline)

Ignore
1510939693
Reply with quote  #2

1510939693
Report to moderator
A blockchain platform for effective freelancing
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
pedrog
Legendary
*
Offline Offline

Activity: 1624



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
*
Online Online

Activity: 1974



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
Member
**
Offline Offline

Activity: 88


View Profile
February 26, 2016, 07:34:47 AM
 #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.
CIYAM
Legendary
*
Offline Offline

Activity: 1862


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: 173


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

Ciyam is right, do secp256k1-based ECDH then AES

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

Activity: 182


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: 1862


Ian Knowles - CIYAM Lead Developer


View Profile WWW
February 27, 2016, 12:10:28 PM
 #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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!