https://github.com/rishflab/ecdsa
https://github.com/rishflab/ecdsa
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/rishflab/ecdsa
- Owner: rishflab
- Created: 2021-04-06T06:38:35.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-07T06:29:26.000Z (about 5 years ago)
- Last Synced: 2025-02-13T06:17:52.753Z (over 1 year ago)
- Language: Rust
- Size: 5.86 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ECDSA signatures
#### Motivation
Bob wants prove that Alice has said something but Alice does not want anyone to be able to impersonate her.
## Review
### Group operations
```
X = x * G
```
where
`x` is a secret key. It is a a **scalar** (regular integer),
`G` is the generator (an agreed upon **point** on an elliptic surve)
`X` is the public key that corresponds to `x`
`*` is the group operation, the bouncing/mirroring thing from last week
`x * G` means we are applying the group operation to `G`, `x` number of times.
### Public and private keys
```
X = x * G
```
where `x` is the private key (scalar) and `X` is the public key (point)
### Inverse
```
s * s^-1 = 1
```
The inverse of a value multiplied by the inverse is 1
## Signing
The signature is a tuple `(r,s)`
```
(r, (k^-1 * H) + (k^-1 * r * x))
```
where `r` is a random point on the curve `r = k * G`
and `k` is a random scalar
## Verification
We want to recompute `s` using the public key `X`.
If the recomputed value matches, the `s` in the signature, the signature is valid