Skip to content

Deadstatic77/asymmetric-keys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DOCUMENTATION

Soon to come

MATHEMATICAL EXPLANATION

Foreword: This is my understanding of how mathematics works, and my mathematical definitions. I am not sure how correct these are, and I may be completely wrong; but this is how I understand things as they are and how I made this asymmetric system work. I'm not very good at mathematics, so don't come after me for being wrong!

Modulo

A modulo or mod() is a function that calculates the remainder of a division operation between two numbers. For example, (7/3) = 2 (well actually 2.333...) with a remainder of 1. We can target only the remainder with the modulo operator (%). Therefore, (7%3) = 1.

Matrix

A set of numbers compressed into a table. In python, this can be represented as a 2D list, shown here:
matrix = [[1,2,3],[4,5,6], [6,7,8]]

Matrix Determinate

A scalar value that is calculated from the elements of a square matrix, modulo the prime. If the determinate is equal to non zero, then the matrix in invertible. If the determinate is equivalent to zero, then the matrix cannot be inverted.

Matrix Determinate Inverse

A determinate inverse is simply just the matrix determinate to the power of negative 1 (-1).

Vector

A three number column. Example:
[x1,x2,x2]

Matrix-vector multiplication:

Multiplying the given matrix by the given vector. In this code, the given matrix is a 3x3 square matrix, and the given vector is a 1x3 matrix. Example:
3x3 square matrix ⋅ 1x3 vector matrix is a demonstration of matrix-vector multiplication.

Matrix Cross Term

A cross term is a component of an equation that contains a variable that does not belong to that equations intended coordinate. It is produced by a mixing operation such as matrix multiplication. Example:
random_matrix = [[1,2,3],[4,5,6], [6,7,8]]
private_key = [[x1],[x2],[x3]] = [[9],[10],[11]]
Matrix-vector multiplication: y = random_matrix ⋅ private_key
Compute the first coordinate (of 9):
y1 = (1 ⋅ x1) + (2 ⋅ x2) + (3 ⋅ x3)
y1 = (1 ⋅ 9) + (2 ⋅ 10) + (3 ⋅ 11)
y1 = (4) + (10) + (18)
y1 = 32

1 ⋅ x1 is the native term
2 ⋅ x2 is a cross term
3 ⋅ x3 is a cross term
x2 and x3 (represented as (2 ⋅ 5 = 10) and (3 ⋅ 6 = 18)) are cross terms as they have crossed into a coordinate that is meant to represent only x1. This is intentional.

Matrix Minor

The minor of an element of a matrix is the determinant of the sub-matrix formed by deleting a row and column in which the element is located. Example:
A = [[1,2,3],[4,5,6],[7,8,9]]
The minor of element 1 (position A[0][0]) is the determinant of the 2x2 matrix obtained by removing the first row and first column, which produces:
A[0][0] = [[5,6],[8,9]]

Matrix Cofactor (signed minor)

A cofactor of an element of a matrix is equal to the minor of that element multiplied by (-1)^(i+j), where i and j are the rows and column indices of the element.
A cofactor is the signed determinant of the smaller matrix that remains after removing the elements row and column.

Matrix Transposition

Matrix transposition is a new matrix that is created by flipping the original matrix over its diagonal, and swapping the rows and columns. For example,
m ⋅ n will transpose into n ⋅ m; turning the element aij into aji

Matrix Adjugate

An adjugate matrix is a matrix that is comprised of the cofactors of the original matrix, transposed. The adjugate matrix is necessary when inverting a matrix through the formula
M^(-1)=(1/determinate) ⋅ adjugate(M)
The adjugate matrix does not contain the cross terms within itself; instead when multiplied by the original matrix and scaled by 1/determinant(M), it cancels out all cross terms and produces the original matrix.

Releases

No releases published

Packages

 
 
 

Contributors

Languages