A Beginner’s Guide: Private and Public Key Cryptography Deciphered

Chris Coverdale
Feb 26, 2018 · 5 min read
Image for post
Image for post

This article will explain at a high-level

We will be looking at how are generated, why this is secure and how .

Discover and review best Crypto softwares


Why?

  • Provide a high-level, easy to digest explanation of a complex topic
  • Greater insight and understanding on how Bitcoin derives some of its security features
  • By generating a , we have a way to interact with other people on the network openly, for example we may have some Bitcoin “attached” to our
  • The only way for us to prove that we own that Bitcoin is to prove that the was
Image for post
Image for post
We are going to make this simple to understand

What is a Private Key?

  • A private key, is simply an extremely large and highly random number
  • The image below shows a generated by a wallet program written by me
Image for post
Image for post
Generated Private Key

What is a Public Key?

  • can be shared with other people on the network
  • We can generate from the
  • are used by other users on the network to challenge ownership of Bitcoins
  • This is a generated from our above
Image for post
Image for post
Public Key shown as hexadecimal representation of bytes

How are Public Keys generated?

  • From a we can generate a
  • The is an (x ,y) co-ordinate on an
  • The would be any point on this curve
Image for post
Image for post
Elliptic Curve

  • The is used as a (All this means is that Private Key Number is used as a multiplier)
  • All we need to know for now, is that there is a publicly known point on this curve, lets call it
  • will be our starting position and has an (x, y) co-ordinate
Image for post
Image for post
G is a publicly known point

  • What we do next is multiply the (x, y) co-ordinate by itself
  • In other words, we are performing
  • When this occurs, there is a effect, this point will bounce around the like in a pin ball machine, hitting another point on the curve, reflecting over the x-axis and this is
  • Once this process is complete, we have our viola!
  • Our is nothing more than a (x, y) co-ordinate on a curve
Image for post
Image for post
“Pin Ball” Effect, Point G is bounced around the curve

How does this provide security?

  • Ok so we’ve simplified some complex topics
  • For a more detailed look at here is a link to my next article <Watch this space for a new article>
  • The only way our , therefore our can be comprised is by revealing our

Let’s do an Experiment

  • In the image below, we can see a billiards table and the starting position of the cue ball
  • Lets say this starting position is our point on the
Image for post
Image for post
Our starting position G

  • After knocking the cue ball around the billiards table we stop at our final position
  • Let’s say this final position is our (x, y) position on the , making it our
Image for post
Image for post
Our final position, the Public Key point
  • Can you tell me from looking at the starting position of the cue ball ( and the final position of the cue ball ()…
  • Please try and guess before looking at the answer…

  • I have video evidence… (Yes I did spend time knocking that cue ball around)
Cue ball bouncing around example
  • The answer is 36

The Discrete Log Problem

  • Using the experiment above, we can demonstrate a key security feature of known as
  • By knowing the starting position () and the final position () we the (), given we are dealing with extremely large numbers
  • This equation , also known as a given publicly known information
  • It’s easy to create the given the
  • But it’s to calculate the from the
Image for post
Image for post
Trap-door function

Conclusion

  • are simply extremely large and random numbers
  • are (x, y) points on an , generated by using the
  • derives its security from the , given the and , it’s difficult to deduce the
  • are, it’s easy to create the given the but extremely difficult to
Image for post
Image for post

Knowledge gained in this article was from Jimmy Song’s Programming Blockchain 2-day Seminar.

I highly recommend this course to any programmer serious about cutting their teeth into Bitcoin and Blockchain Technology (Not for the faint of heart)

Image for post
Image for post

Interested in going further down the rabbit hole?

<Learn about Elliptic Curves and the Maths behind them>

Coinmonks

Coinmonks is a non-profit Crypto educational publication.

Sign up for Crypto News

By Coinmonks

A newsletter that brings you week's best crypto and blockchain stories and trending news directly in your inbox, by CoinCodeCap.com Take a look

By signing up, you will create a Medium account if you don’t already have one.

Check your inbox
Click the link Medium sent to to verify your email address.

Chris Coverdale

Written by

Blockchain Developer - Founder - Pale Fire Technologies, working on Bitcoin and LND

Coinmonks

Coinmonks

Coinmonks is a non-profit Crypto educational publication. Follow us on Twitter @coinmonks Our other project — https://coincodecap.com

Chris Coverdale

Written by

Blockchain Developer - Founder - Pale Fire Technologies, working on Bitcoin and LND

Coinmonks

Coinmonks

Coinmonks is a non-profit Crypto educational publication. Follow us on Twitter @coinmonks Our other project — https://coincodecap.com

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store