{"id":1616,"date":"2017-12-03T19:23:09","date_gmt":"2017-12-03T19:23:09","guid":{"rendered":"http:\/\/www.talkcrypto.org\/blog\/?p=1616"},"modified":"2017-12-03T19:23:09","modified_gmt":"2017-12-03T19:23:09","slug":"being-schooled-in-digital-signatures","status":"publish","type":"post","link":"https:\/\/www.talkcrypto.org\/blog\/2017\/12\/03\/being-schooled-in-digital-signatures\/","title":{"rendered":"Being Schooled in Digital Signatures"},"content":{"rendered":"<p>I&#8217;ve read so much about digital signatures but still didn&#8217;t truly understand what they were. I managed to get a one on one with an engineer cryptographer called Weiwu and it was amazing.<\/p>\n<p>It goes something like this:<\/p>\n<ol>\n<li>Start of with a message. eg &#8220;I own this piece of land at 21 To The Moon Avenue&#8221;<\/li>\n<li>Hash the message. Let&#8217;s call this e.<\/li>\n<li><a href=\"https:\/\/www.macworld.co.uk\/how-to\/mac-software\/how-generate-ssh-keys-3521606\/\" target=\"_blank\" rel=\"noopener\">Generate<\/a> a set of keys. ie a public and private key. Let&#8217;s call the private key d<\/li>\n<li>Generate a random number k.<\/li>\n<li>Sign the message with the function sign(e, d, k).<\/li>\n<\/ol>\n<p>That is pretty much it. To get hands on, try these commands:<\/p>\n<p class=\"p1\"><span class=\"s1\">In OpenSSL &#8211; create private\/public keys, sign and verify:<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">openssl ecparam -name secp256k1 -genkey -out private.pem<br \/>\n<\/span><span class=\"s1\">openssl ec -in private.pem -pubout -out public.pem<br \/>\n<\/span><span class=\"s1\">echo|set \/p=&#8221;ABCDEFGHIJKLMNOPQRSTUVWXYZ012345&#8243; &gt; message.dat<br \/>\n<\/span><span class=\"s1\">openssl dgst -ecdsa-with-SHA1 -sign private.pem -out signature.dat message.dat<br \/>\n<\/span><span class=\"s1\">openssl dgst -ecdsa-with-SHA1 -verify public.pem -signature signature.dat message.dat<\/span><\/p>\n<p>Ref: https:\/\/github.com\/kmackay\/micro-ecc\/issues\/89<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve read so much about digital signatures but still didn&#8217;t<\/p>\n","protected":false},"author":1,"featured_media":1672,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1616","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blockchain"],"featured_image_urls":{"full":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/11\/weiwu300.jpg",300,194,false],"thumbnail":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/11\/weiwu300-150x150.jpg",150,150,true],"medium":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/11\/weiwu300-300x194.jpg",300,194,true],"medium_large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/11\/weiwu300.jpg",300,194,false],"large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/11\/weiwu300.jpg",300,194,false],"1536x1536":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/11\/weiwu300.jpg",300,194,false],"2048x2048":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/11\/weiwu300.jpg",300,194,false],"chromenews-featured":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/11\/weiwu300.jpg",300,194,false],"chromenews-large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/11\/weiwu300.jpg",300,194,false],"chromenews-medium":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/11\/weiwu300.jpg",300,194,false]},"author_info":{"info":["seandotau"]},"category_info":"<a href=\"https:\/\/www.talkcrypto.org\/blog\/category\/blockchain\/\" rel=\"category tag\">Blockchain<\/a>","tag_info":"Blockchain","comment_count":"0","_links":{"self":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/1616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/comments?post=1616"}],"version-history":[{"count":1,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/1616\/revisions"}],"predecessor-version":[{"id":1619,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/1616\/revisions\/1619"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/media\/1672"}],"wp:attachment":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/media?parent=1616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/categories?post=1616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/tags?post=1616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}