Elliptic Curve Cryptography: 轻轻的学

  • Elliptic curves
  • Algebraic addition
  • Scalar multiplication
  • Multiplicative inverse modulo ppp
  • Elliptic curves in Fp\mathbb{F}_pFp​, the field of integers modulo ppp
  • Discrete logarithm
  • ECC domain parameters

Elliptic curves

Elliptic curves over real numbers and the group law .

An elliptic curve will simply be the set of points described by the equation:
y2=x3+ax+by^2 = x^3+ax+b y2=x3+ax+b
where 4a3+27b2≠04a^3+27b^2 \neq 04a3+27b2​=0

Algebraic addition

Given two non-zero, non-symmetric points P=(x1,y1)P = (x_1, y_1)P=(x1​,y1​) and Q=(x2,y2)Q = (x_2, y_2)Q=(x2​,y2​). The line through them has slope
m=y1−y2x1−x2m = \frac{y_1-y_2}{x_1-x_2} m=x1​−x2​y1​−y2​​
The intersection of this line with the elliptic curve is point R=(xR,yR)R = (x_R, y_R)R=(xR​,yR​) where
xR=m2−x1−x2yR=y1+m(xR−x1)=y2+m(xR−x2)x_R = m^2-x_1-x_2 \\ y_R = y_1 + m(x_R-x_1) = y_2 + m(x_R-x_2) xR​=m2−x1​−x2​yR​=y1​+m(xR​−x1​)=y2​+m(xR​−x2​)
such that
P+Q+R=0P+ Q + R = 0P+Q+R=0 or P+Q=−RP + Q = -RP+Q=−R.

The case of P=QP=QP=Q needs to be treated differently since x1=x2x_1=x_2x1​=x2​, we must use a different equation for the slope
m=3x12+a2y1m = \frac{3x_1^2+a}{2y_1} m=2y1​3x12​+a​

Scalar multiplication

The double and add algorithm:

def bits(n):"""Generates the binary digits of n, startingfrom the least significant bit.bits(151) -> 1, 1, 1, 0, 1, 0, 0, 1"""while n:yield n & 1n >>= 1def double_and_add(n, x):"""Returns the result of n * x, computed usingthe double and add algorithm."""result = 0addend = xfor bit in bits(n):if bit == 1:result += addendaddend *= 2return result

Multiplicative inverse modulo ppp

Computing the multiplicative inverse can be “easily” done with the extended Euclidean algorithm. Here is a working Python implementation:

def extended_euclidean_algorithm(a, b):"""Returns a three-tuple (gcd, x, y) such thata * x + b * y == gcd, where gcd is the greatestcommon divisor of a and b.This function implements the extended Euclideanalgorithm and runs in O(log b) in the worst case."""s, old_s = 0, 1t, old_t = 1, 0r, old_r = b, awhile r != 0:quotient = old_r // rold_r, r = r, old_r - quotient * rold_s, s = s, old_s - quotient * sold_t, t = t, old_t - quotient * treturn old_r, old_s, old_tdef inverse_of(n, p):"""Returns the multiplicative inverse ofn modulo p.This function returns an integer m such that(n * m) % p == 1."""gcd, x, y = extended_euclidean_algorithm(n, p)assert (n * x + p * y) % p == gcdif gcd != 1:# Either n is 0, or p is not a prime number.raise ValueError('{} has no multiplicative inverse ''modulo {}'.format(n, p))else:return x % p

Elliptic curves in Fp\mathbb{F}_pFp​, the field of integers modulo ppp

Restrict elliptic curves over Fp\mathbb{F}_pFp​. An elliptic curve defined over a finite field has a finite number of points. The number of points in a group is called the order of the group.

Lagrange’s theorem states that the order of a subgroup is a divisor of the order of the parent group.

For ECC algorithms, we want subgroups with a high order. We will first choose an order that looks high enough, and then hunt for a suitable base point.

Discrete logarithm

The problem, known as the discrete logarithm problem for elliptic curves, is believed to be a “hard” problem, in that there is no known polynomial time algorithm that can run on a classical computer.

If we know PPP and QQQ, what is kkk such that Q=kPQ = kPQ=kP?

Scalar multiplication remains “easy”, while the discrete logarithm becomes a “hard” problem. This duality is the key brick of elliptic curve cryptography.

ECC domain parameters

Elliptic curve algorithms will work in a cyclic subgroup of an elliptic curve over a finite field. Therefore, will need the following parameters:

  • The prime ppp that specifies the size of the finite field
  • The coefficients aaa and bbb of the elliptic curve equation
  • The base point GGG that generates our subgroup
  • The order nnn of the subgroup
  • The cofactor hhh of the subgroup
  1. The private key is a random integer ddd chosen from {1,...,n−1}\{1,...,n-1\}{1,...,n−1}
  2. The public key is the point H=dGH = dGH=dG

If we know HHH and GGG, finding the private key ddd is “hard”, because it requires us to solve the discrete logarithm problem.

Encryption with ECDH (Elliptic curve Diffie-Hellman), digital signing with ECDSA (Elliptic Curve Digital Signature Algorithm)

Elliptic Curve Cryptography: 轻轻的学相关推荐

  1. Elliptic Curve Cryptography: a gentle introduction

    转载自:https://www.jianshu.com/p/2e6031ac3d50?from=groupmessage 原文链接:https://andrea.corbellini.name/201 ...

  2. Elliptic Curve Cryptography (ECC) and Pairings 椭圆曲线密码学与配对

    本文是Dan Boneh 和Victor Shoup所写书籍A Graduate Course in Applied Cryptography的笔记. The group of points of a ...

  3. 椭圆曲线加密(Elliptic Curve Cryptography, ECC)

    近年来,国内外的科研人员面向设备资源受到限制的多种场景提出了很多基于ECC的认证密钥协商协议.虽然各协议应用场景不尽相同,但解决的问题和最终的目标都较为类似,可以归纳为在性能开销尽可能小的前提下,安全 ...

  4. 【转】Guide to Elliptic Curve Cryptography(ECC椭圆曲线算法1)

    Guide to Elliptic Curve Cryptography (ECC椭圆曲线算法1) 2017年06月03日 10:14:08 原文 http://andrea.corbellini.n ...

  5. Elliptic curve cryptography

    原文来自wiki 翻译参照Bing在线翻译 - - 部分翻译 Elliptic curve cryptography From Wikipedia, the free encyclopedia Jum ...

  6. 《A Graduate Course in Applied Cryptography》Chapter 15 Elliptic curve cryptography and pairings (1)

    原文教材 与 参考资料: Boneh Dan , Shoup Victor . A Graduate Course in Applied Cryptography[J]. 该书项目地址(可以免费获取) ...

  7. Elliptic Curve Cryptography: finite fields and discrete logarithms

    转载自:https://andrea.corbellini.name/2015/05/23/elliptic-curve-cryptography-finite-fields-and-discrete ...

  8. ECC(Elliptic Curve Cryptography)椭圆曲线密码详解

    椭圆曲线密码基于离散对数难题 公钥密码 ECC 非对称密钥功能:加密.签名.密钥交换 ECC是RSA的后继更短的密钥长度.更快的签名.更快的密钥协商 私钥长度为256bits, 32字节.大小在曲线的 ...

  9. Guide to Elliptic Curve Cryptography (ECC椭圆曲线算法1)

    原文 http://andrea.corbellini.name/2015/05/17/elliptic-curve-cryptography-a-gentle-introduction/ Prefa ...

最新文章

  1. java f.add()_f.add(p1,First); 那个“First”是什么意思呀?
  2. 重磅发布!阿里云云效《阿里巴巴DevOps实践指南》
  3. 简单使用Boost线程池threadpool
  4. 微信小程序定时器setInterval()的使用注意事项
  5. JSON字符串与Map互转
  6. python---图表的使用
  7. 前端中常用的PS操作
  8. 如果站做的比较大,那么关键词和内页的分布就要比别人高一个档次
  9. C++ Learning (Next)
  10. linux NM 命令使用介绍
  11. python分数约分_Python基础知识
  12. 区块链龙头股都有哪些?区块链概念股有哪些?
  13. hdu 1024 Max Sum Plus Plus(dp 最大m子段和)
  14. 计算共形几何-代数拓扑
  15. Oracle Mutex实现机制
  16. 晶体三极管结构及其工作原理详解
  17. 学人工智能需要什么学历?AI学历要求
  18. ubuntu 安装FoxitReader福昕阅读器
  19. numpy inf、reshape()、random.randint()、bincount()函数
  20. jsp页面div浮动在img上面

热门文章

  1. jstat gc命令详解
  2. 物联网体系的系统构架和用途
  3. Spark SQL 在SparkStreaming中的运用
  4. 不会写简历?阿里Java技术架构师教你如何写好你的技术简历
  5. uni-app项目实现用户注册密码前端页面加密
  6. delphi中setTimer函数的用法
  7. 淘宝授权登录对接文档
  8. 基于Springboot搭建个人博客 (学习笔记)
  9. 什么的出现标志着电子计算机的到来,20世纪四五十年代以来,人类在原子能、计算机、航天技术、电力机械等方面取得了重大突破,标志着新的科学技术革命的到来。——青夏教育精英家教网——...
  10. Android实现Line登录分享