Be a crypto hero in the market by logging in

Don't you have an account? Sign in

Token price

  • BTC

    10,684,557.6KRW

    5.3%

  • ETH

    204,571.5KRW

    3.3%

  • XRP

    276.4KRW

    2.1%

  • BCH

    436,346.7KRW

    4.2%

  • BSV

    362,491.8KRW

    10.0%

  • USDT

    1,175.7KRW

    0.1%

  • EOS

    4,813.2KRW

    10.0%

  • LTC

    54,759.1KRW

    -0.5%

  • BNB

    21,035.1KRW

    2.3%

  • ADA

    57.1KRW

    8.2%

  • ETC

    12,539.0KRW

    15.4%

  • XLM

    71.4KRW

    3.4%

  • XMR

    78,667.5KRW

    4.7%

  • TRX

    20.4KRW

    2.9%

  • DASH

    136,121.7KRW

    1.6%

  • XTZ

    1,780.1KRW

    -0.7%

  • ATOM

    5,360.8KRW

    1.9%

  • NEO

    13,348.6KRW

    4.6%

  • HEDG

    3,207.4KRW

    6.6%

  • HT

    3,821.5KRW

    2.8%

  • MKR

    595,808.7KRW

    4.7%

  • ZEC

    66,702.3KRW

    4.2%

  • USDC

    1,204.3KRW

    1.1%

  • ONT

    816.6KRW

    7.1%

  • XEM

    48.6KRW

    1.7%

  • BAT

    269.5KRW

    7.9%

  • VET

    6.8KRW

    1.1%

  • DOGE

    2.8KRW

    4.4%

  • BTG

    14,701.0KRW

    9.5%

  • PAX

    1,180.9KRW

    0.4%

  • INB

    699.2KRW

    28.2%

  • DCR

    21,916.9KRW

    2.5%

  • QTUM

    2,380.8KRW

    4.1%

  • REP

    17,221.3KRW

    0.6%

  • RVN

    31.9KRW

    2.4%

  • ZRX

    276.0KRW

    1.5%

  • LINK

    485.1KRW

    2.0%

  • TUSD

    1,176.0KRW

    0.1%

  • ALGO

    283.9KRW

    1.2%

  • BCD

    763.9KRW

    6.5%

  • CNX

    2,529.5KRW

    3.8%

  • XIN

    288,905.2KRW

    2.6%

  • XIN

    288,905.2KRW

    2.6%

  • OMG

    958.8KRW

    2.3%

  • LSK

    920.2KRW

    -1.2%

  • NANO

    817.5KRW

    1.3%

  • ICX

    209.5KRW

    -0.6%

  • THETA

    120.6KRW

    0.2%

  • WAVES

    1,026.1KRW

    1.1%

  • KCS

    1,257.6KRW

    2.3%

  • BTM

    100.9KRW

    1.6%

  • BTM

    100.9KRW

    1.6%

  • DGB

    7.6KRW

    1.7%

  • MONA

    1,415.7KRW

    0.6%

  • MCO

    5,704.9KRW

    3.0%

  • NEXO

    150.3KRW

    14.5%

  • ENJ

    103.4KRW

    2.0%

  • IOST

    6.8KRW

    3.7%

  • KMD

    691.2KRW

    0.0%

  • HC

    1,814.4KRW

    4.4%

  • SC

    1.8KRW

    2.8%

  • STEEM

    203.4KRW

    9.4%

  • XVG

    4.4KRW

    2.6%

  • ABBC

    115.0KRW

    -3.4%

  • BCN

    0.3KRW

    -3.7%

  • BTS

    22.7KRW

    2.8%

  • AE

    200.9KRW

    3.7%

  • ZIL

    6.0KRW

    0.8%

  • XZC

    6,288.7KRW

    3.6%

  • QNT

    4,814.9KRW

    12.7%

  • MAID

    125.2KRW

    7.7%

  • MATIC

    19.9KRW

    2.0%

  • ARDR

    50.7KRW

    0.7%

  • ETN

    5.0KRW

    5.2%

  • SNT

    12.7KRW

    1.7%

  • MANA

    41.7KRW

    0.8%

  • GNT

    43.8KRW

    1.4%

  • BEAM

    754.2KRW

    3.9%

  • STRAT

    401.1KRW

    1.4%

  • GRIN

    1,221.6KRW

    1.6%

  • ELF

    72.6KRW

    2.7%

  • NPXS

    0.2KRW

    3.5%

  • TOMO

    528.8KRW

    -1.5%

  • AION

    89.3KRW

    0.3%

  • ELA

    1,896.8KRW

    1.4%

  • DAI

    1,196.7KRW

    1.0%

  • FET

    46.0KRW

    0.1%

  • LRC

    30.2KRW

    0.5%

  • PAI

    19.1KRW

    21.4%

  • PAI

    19.1KRW

    21.4%

  • WAX

    25.8KRW

    3.4%

  • WTC

    453.1KRW

    -2.6%

  • TRUE

    323.9KRW

    4.0%

  • RDD

    0.8KRW

    6.9%

  • ANT

    773.3KRW

    6.5%

  • ARK

    201.9KRW

    9.4%

  • PPT

    404.8KRW

    -2.9%

  • R

    44.5KRW

    6.7%

  • LAMB

    30.9KRW

    0.5%

  • FCT

    2,421.7KRW

    3.8%

  • POWR

    49.5KRW

    -0.6%

  • LOOM

    20.4KRW

    -3.5%

  • FTM

    10.8KRW

    -5.3%

  • BNT

    282.5KRW

    3.4%

  • PIVX

    329.2KRW

    0.9%

  • OCEAN

    47.2KRW

    4.7%

  • DENT

    0.2KRW

    5.2%

  • ABT

    159.4KRW

    1.2%

  • CET

    17.0KRW

    2.6%

  • MOAC

    230.3KRW

    1.1%

  • ODE

    65.2KRW

    1.3%

  • TTC

    31.9KRW

    -6.0%

  • AOA

    1.8KRW

    -2.1%

  • POLY

    22.9KRW

    -4.5%

  • REPO

    71.4KRW

    -23.7%

  • BCV

    7.5KRW

    1.4%

  • MBL

    1.8KRW

    1.6%

  • PAY

    45.8KRW

    -0.0%

  • CPT

    2.0KRW

    1.4%

  • BORA

    9.2KRW

    5.7%

  • INS

    187.0KRW

    -1.8%

  • COSM

    8.2KRW

    1.9%

  • GUSD

    1,210.7KRW

    2.0%

  • UPP

    15.2KRW

    7.2%

  • BAAS

    1.0KRW

    -1.9%

  • FNB

    2.3KRW

    -2.5%

  • LKY

    89.5KRW

    0.4%

  • FLETA

    8.2KRW

    -0.9%

  • AERGO

    34.6KRW

    0.4%

  • RBG

    1.0KRW

    3.3%

  • HUM

    6.4KRW

    2.6%

  • MVL

    0.4KRW

    6.9%

  • EOSC

    2.7KRW

    -1.8%

  • DCC

    0.9KRW

    0.4%

  • eDEL

    2.4KRW

    -0.7%

  • VRA

    0.5KRW

    7.0%

  • RBTC

    10,595,220.5KRW

    7.6%

  • ABL

    6.7KRW

    2.6%

  • AKRO

    1.4KRW

    -16.9%

  • MEETONE

    0.7KRW

    7.7%

  • TEMCO

    0.4KRW

    -2.3%

  • AID

    2.5KRW

    -0.8%

  • XRA

    8.8KRW

    19.6%

  • PXL

    19.9KRW

    -3.0%

  • CLB

    1.6KRW

    -4.9%

  • AMON

    1.3KRW

    5.7%

  • WET

    3.8KRW

    -2.4%

  • SEAL

    1.0KRW

    35.0%

  • PTON

    0.0KRW

    13.9%

  • WIKEN

    1.7KRW

    -9.5%

  • NEWS

    1.8KRW

    3.4%

  • PUB

    0.2KRW

    6.4%

  • NPER

    3.4KRW

    0.4%

  • HORUS

    0.2KRW

    3.1%

  • KARMA

    0.0KRW

    3.3%

  • PUT

    2.2KRW

    2.8%

  • CCH

    0.0KRW

    0.4%

  • KNT

    0.0KRW

    -48.4%

  • APIX

    0.5KRW

    -2.0%

  • IQ

    3.0KRW

    9.4%

  • BLACK

    14.3KRW

    3.1%

  • RCD

    3.0KRW

    --%

  • MCC

    4.4KRW

    0.4%

  • INC

    0.3KRW

    40.3%

  • BZKY

    0.3KRW

    0.4%

  • CRE

    1.3KRW

    5.0%

Community

Learning Cryptography, Part 3: Elliptic Curves

Loopring | 08.16| 126

Introduction

Elliptic Curve Cryptography (ECC) was introduced in 1985 and has been one of the biggest advances in the field since then. It took 25 years of trial and testing before it was used in production by OpenSSL. Delays like this aren’t uncommon since the bridge between theoretical and practical cryptography can only be proven through the test of time.

ECC’s biggest downside lies in the inherent fact that it’s complex. Its upside lies in the fact that its 256-bit key is stronger and more efficient than RSA’s 4096-bit key. Rather than relying on large numbers alone, elliptic curves obtain their security by combining points on mathematical curves.

So what are elliptic curves?

We define elliptic curves as a group of x and y coordinates represented on a graph via an equation such as y^2=x^3–7x+10 represented below. Wherever there exists a valid x-value which corresponds to a y-value, we call that a pair on the curve that satisfies the equation. Example points for our example equation are represented below.

The curve y²=x³–7x+10.

Real-world elliptic curves aren’t too different from this, although this is just used as an example.

You can try calculating a point yourself by plugging in the numbers:

  • y^2=x^3–7x+10
  • y^2=(2)3–7(2)+10
  • y^2=8–14+10
  • y^2=4
  • y=2

The point (2, 2) exists on the graph above and is considered a valid pair. An example of an invalid pair would be where the x-value is less than ~ -3.1, since no y-value can be determined when substituted into the equation.

Elliptic Curve Integers

Our elliptic curve depicted above can be represented as a group of integers represented by each y-value modulo a prime number.

Below is the group of integers represented by the equation y^2=x^3–7x+10 mod 19.

We can derive these points ourselves as well. Let’s take the point where x = 5.

  • y^2 mod 19=x^3–7x+10 mod 19
  • y^2 mod 19=(5)^3–7(5)+10 mod 19
  • y^2 mod 19=125–35+10 mod 19
  • y^2 mod 19=100 mod 19
  • y^2 mod 19=5
  • y=9 or 10 (y=9*9=81 mod 19 = 5 or 10*10 =100 mod 19 = 5)

Instead of using modulo 19, what if we used 97? Suddenly we get 82 points instead of 24.

To make this even more obvious, if we used modulo 127 then we’d get 133 points.

Point Addition

Adding points on an elliptic curve are relatively easy to understand. All we do is draw a line between the two points on our graph, find the third point of intersection on the curve and reflect it on the. I’ve illustrated how it works visually below.

To recap our geometrical method of doing point addition:

  1. Choose your point P;
  2. Choose your point Q you want to add P to;
  3. Find the third point of intersection;
  4. Reflect the third point of intersection along the y-axis to get your final result.

As easy and straight forward as this method is, it won’t always work and isn’t how computers do point addition. Instead:

  1. We need to find the gradient of the two points in the form of y=mx+c;
  2. Find the point of intersection between the two curves where (mx+c)2=x3–7x+10;
  3. Depending on our range of solutions we need to do point addition or double the point itself (which we’ll cover soon).

Adding a Point to its Negative

Each point P on an elliptic curve has an inverse defined as “the point at infinity”. Finding the point at infinity is as simple as finding the point of intersection along the y-axis with the mirror image. The point itself is virtual and doesn’t intersect the curve. It’s best described as a virtual point that describes what 0 is to integers.

Adding a Point to Itself (Doubling a Point)

You may be a bit overwhelmed with the number of concepts presented but if there’s anything you need to pay attention to, it’s this part. If we want to add a point P to itself, we call the operation doubling. It works a little something like this:

  1. Draw a tangent to the curve at point P;
  2. Find the first point of intersection with the elliptic curve;
  3. Reflect the intersection point along the y-axis;
  4. You now have your point defined as 2P = P + P.

Multiplying Two Points

Just like regular multiplication, point multiplication relies on multiple point addition operations. If you need to multiply P, k times then you just execute a series of addition operations. For example:

  • 2P=P+P
  • 3P=P+P+P
  • 4P=P+P+P+P
  • and so on…

Point addition in this manner would take a long time especially if we’re dealing with much larger numbers. So how can we speed this process up? Well, there’s a little trick we can utilize called the “Fast Exponentiation Algorithm”. Here’s how we could use it to find out what 32P is:

  • 2P=P+P
  • 4P=2P+2P
  • 8P=4P+4P
  • 16P=8P+8P
  • 32P=16P+16P

As you can see this took us just 6 steps rather than 32 steps. Thinking about the costs of computation and optimizing it takes us to the branch of complexity theory which we’ll touch later on.

Closing

This is by far one of the more complicated articles in this series. Our goal was to introduce you to the basics of elliptic curves, how they’re formed and the types of operations we can do on them. Upcoming parts will talk about how we utilize the properties of elliptic curves for the public key and private key cryptography in today’s world.

About Loopring

Loopring is a decentralized exchange protocol utilizing zkSNARKs to bring highly scalable, non-custodial trading to the masses. You can sign up for their bi-weekly update, and learn more at:

⭑ Twitter: twitter.com/loopringorg
⭑ Reddit: reddit.com/r/loopringorg
⭑ Telegram: t.me/loopring_en & t.me/loopringfans (Chinese)
⭑ Discord: discord.gg/KkYccYp
⭑ GitHub: https://github.com/Loopring
⭑ Kakao: open.kakao.com/o/gJbSZdF (Korean)


Learning Cryptography, Part 3: Elliptic Curves was originally published in Loopring Protocol on Medium, where people are continuing the conversation by highlighting and responding to this story.

Comment 0

delete

Are you sure you want to delete this post?