Author

Topic: Encrypt/decrypt arbitrary text using bitcoin keys! (Read 4694 times)

legendary
Activity: 1708
Merit: 1020
Well it is public and private key encryption this is the bread and butter of SSL and TLS. So yes is extremely secure.

it is posible but lets take that idea one step further ?

The issue with ssl is that you need to send public key from a server to the client. Having these key's stored in a block chain would make the whole system a lot more secure sins it would become nearly impossible for a man in the middle to send false key's to a client that checks a block chain for valid keys. At the same time it would would eliminate the all powerful CA's that have been know to hide and/or deny hacks and leaked private key's. Yes / No ?
it has been thought about it for namecoin a long time ago. Only now do I realize that it could be done directly with the namecoin keys.

there is even a small bounty available for implementing it: https://bitcointalksearch.org/topic/nmc-bounty-3btc-implement-tls-website-identification-support-117795

Quote
If only I had time/knowledge to implement something like that ... but a man can dream right.
+1 Smiley
full member
Activity: 182
Merit: 100
Well it is public and private key encryption this is the bread and butter of SSL and TLS. So yes is extremely secure.

it is posible but lets take that idea one step further ?

The issue with ssl is that you need to send public key from a server to the client. Having these key's stored in a block chain would make the whole system a lot more secure sins it would become nearly impossible for a man in the middle to send false key's to a client that checks a block chain for valid keys. At the same time it would would eliminate the all powerful CA's that have been know to hide and/or deny hacks and leaked private key's. Yes / No ?

If only I had time/knowledge to implement something like that ... but a man can dream right.
legendary
Activity: 1708
Merit: 1020
Well it is public and private key encryption this is the bread and butter of SSL and TLS. So yes is extremely secure.

 Grin
legendary
Activity: 1708
Merit: 1020
It is possible to encrypt/decrypt messages with the bitcoin keys.

Maybe you are aware of the PyBitmessage project by Atheros: https://bitcointalksearch.org/topic/announce-bitmessage-p2p-messaging-system-based-partially-on-bitcoin-128230

Its code can be used to do this:

Code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from highlevelcrypto import *
from pyelliptic import arithmetic
from binascii import hexlify, unhexlify

# msg
plaintext = "Bitcoin is the new world currency."

# from Casascius btc utility
privkeyUtil = "0x29635CB46E2AA93EFF403448E1555DC99F4ECB75898BBF232D769EA5C029A1DF"
pubkeyUtil = "0x04AAC5327CEF4681FEDCA19C5D9C009172484A3497B616376947E81F2E9ED35968A707D3C4966AB49608F047A5F9E29D16ABD35FB4F613D5B5A119EBDD6799C45D"
pubkeyHashUtil = "702B9096868BA888D71326D1F55EC2B20CB84D3A"
addressUtil = "1BE6sRNQgQ28iiYPKBXeyHh1E6LPAdaxfH"

################################################################
# actual work
################################################################
pubkeyEcc = privToPub(privkeyUtil[2:]).upper()
cipher = encrypt(plaintext, pubkeyEcc)
match = bool(decrypt(cipher, privkeyUtil[2:]) == plaintext)
################################################################

# output
print "keys------------"
print "data from Casascius utility"
print "privkey:", privkeyUtil
print "pubkey:", pubkeyUtil
print "address:", addressUtil
print

print "data generated from above privkey with PyBitmessage highlevelcrypto (pyelliptic / openSSL)"

print "pubkey:", pubkeyEcc
print "address:", arithmetic.pubkey_to_address(pubkeyEcc)
print

print "encryption------------"

print "plaintext:", plaintext
print "cipher:", hexlify(cipher)

if match:
    print "decrypt: match"


#output:
##keys------------
##data from Casascius utility
##privkey: 0x29635CB46E2AA93EFF403448E1555DC99F4ECB75898BBF232D769EA5C029A1DF
##pubkey: 0x04AAC5327CEF4681FEDCA19C5D9C009172484A3497B616376947E81F2E9ED35968A707D3C4966AB49608F047A5F9E29D16ABD35FB4F613D5B5A119EBDD6799C45D
##address: 1BE6sRNQgQ28iiYPKBXeyHh1E6LPAdaxfH
##
##data generated from above privkey with PyBitmessage highlevelcrypto (pyelliptic / openSSL)
##pubkey: 04AAC5327CEF4681FEDCA19C5D9C009172484A3497B616376947E81F2E9ED35968A707D3C4966AB49608F047A5F9E29D16ABD35FB4F613D5B5A119EBDD6799C45D
##address: 1BE6sRNQgQ28iiYPKBXeyHh1E6LPAdaxfH
##
##encryption------------
##plaintext: Bitcoin is the new world currency.
##cipher: f8f358b861c041e430024ecbecccaada02ca00203c00513c46364b3f08de80b202e658155093dfd6f0847daff53295a858aafb2000205fef717e5e6935a450930925d8da7aecd02a560a4f8c5ebdad1517e8480724b8fb6fb42db52256c14df788546bd32360604f9cb0ad6ce79d8e98274e54a55526baceb8d559e854f75300114d0148d310d70ad7515e8f8f2e81a416d93d26a4f06d185c69bd64a2384303e9fff393a8ee
##decrypt: match
[/quote]


I am not a cryptographer but from what I understand it should be possible to make this really secure (not sure about the state of the libraries at hand).
Jump to: