Information Security Algorithm Arrangement

DES encryption:

Plaintext (64) Key (56) Ciphertext (64)

Plaintext --> IP permutation --> round function (16) --> inverse IP permutation --> ciphertext

Function: Li = Ri-1 Ri = Li -1 异 or F (Ri-1, ki)

F(Ri-1,ki): E extension, key addition, grouping, s-box substitution, P substitution

Key arrangement algorithm: Divide into C0 D0 28 + 28 and then rotate left, 1 2 9 16 move one bit and the rest move two bits

Too lazy to write, crtl + c

AES encryption:
key addition
round function 10 rounds:
byte substitution s box:
row shift: 0 1 2 3
column mixing: polynomial multiplication with c(x)
key addition
output transformation
ciphertext

DSA
parameter selection
Select large prime numbers p and a prime factor q of p to
calculate g = pow(h, (p-1) * inverse of q) mod p[h∈(1, p-1)]
Select x to calculate public key y = pow(g,x) mod p[x∈(0,q)]
public key ygpq private key x


signature process
Randomly select a number k less than q
r = pow(g,k) mod p mod q
s = k Inverse * (H(m)+ x * r) mod q Inverse mod q u1 = H(m) * w mod q u2 = r * w mod q v = pow(g,u1) * pow of the


verification process
w = s (y,u2) mod p mod q judge v and r pow(y,u2) = pow(g,x * r * w)mod p mod q





ELGMAL algorithm
Choose a large prime number p
Choose a primitive g
Choose an x ​​Calculate y = pow(g,x) mod p
ygp as the public key
x as the private key
Encryption process: the sender chooses a ri
c1 = pow(g, ri) mod p c2 = M * pow(y,ri) mod p
Decryption process: because y = pow(g,x) mod p
so M = c2 / pow(c1,x)


ELGMAL's digital signature
Select the prime number p
primitive Element g
chooses a x
y = pow(g,x) mod p
ygp public key x private key
encryption
r = pow(g,k) mod p
s = (h(m) - x * r) * k inverse mod p
Verify that
pow(r,s) * pow(y,r) = pow(g,h(m)) mod p

elliptic curve public key cryptosystem
Calculate from the known formula and choose a generator G
Choose an XA as the secret key Key
PA = XA * G
PA as public key
Encryption process:
sender chooses a k to send {KG, PM + KPA}
Decryption process:
second - first * key
= PM + KPA(K * XA * G) - K * G * XA


The formula to calculate the addition of two points
x3 = pow(λ, 2) - x1 - x2
y3 = λ* (x1 - x3) - y1 


λ = (y2 - y1) / (x2 - x1) = the inverse of (y2 - y1) * (x2 - x1) when the two points are not the same
λ = (3 * pow(x1,2) + a) * (2 * Inverse of y1)


#Obvious
Elliptic curve digital signature:
Elliptic curve is known
Select a generator G
Select a number d Calculate Q = d * G
public key is p Ep GQ Private key d


Signature process
Select a k
KG = (u, v)
Then
r = u mod p
s = inverse of K * (H(m) + rd) mod p The


verification process is the same as the inverse of DSA
w = s mod p
u1 = H(m) * w mod p
u2 = r * w mod p
calculates u1 * P + u2 * Y = (u,v) then the (r,s) signature is valid


RC4:

S table initialization fill 0~255
K table initialization fill key is not long enough, repeat
I from 0~255
J = J + SI + KI
exchange SI SJ


I from 0~255
J = J + SI
exchange SI and SJ
t = SI + SJ
z = St


RSA encryption algorithm
Choose two large prime numbers PQ
φ(n) = (P -1) * (Q - 1)
take e gcd(e,φ(n)) = 1
d is the inverse of e = e-1 mod φ ( n)
en is the public key d is the private key
Encryption c = pow(m,e) mod n
Decryption m = pow(c,d) mod n


Super-increasing knapsack problem
It is known that super-increasing knapsack A
chooses k and t
such that gcd(t,k) = 1
B = t * A mod k
B k is the public key and t is the private key
Encryption process: C = B * X MOD K
decryption Process: M'= t inverse * C mod k
is calculated according to the super-increasing knapsack rule for each number
.


CBC-MAC XOR
the plaintext into n P1 and IV, then perform DES encryption under the key K, P2...PN and XOR generated in the previous round, and then encrypt the generated Cn generated by Pn, and then truncate the generated MAC. (message authentication code) HMAC 1. Supplement K to get B 2. B XOR ipad 3. Connect TEXT 4. Hash 5.B XOR opad obtained above 6. The fifth step is connected to the fourth step 7. Hash total formula H(B XOR OPAD || H(B XOR IPAD || TEXT))















Secret sharing: The secret is that there are n members who participate in the custody of
S. At least t people are required to reconstruct the message . A sufficiently large prime number p is selected and t-1 modulos s1, s2,...,st-1 are randomly selected Get polynomial s(x) = S + s1x + .. + st-1 pow (x,t-1) mod p randomly select n numbers Calculate yi (xi,yi) for each integer and send it to n members to restore Secret: Calculate the polynomial f(x) = ∑k∈[1,t] yk * Multiply j∈[1,t] and ! =k (x-xj)/(xk - xj) The constant term f(0) constructs a matrix 1 for the required secret S, the corresponding numbers 2, ~~ 3, ~~ 4, ~~ 5, ~~ no center Key distribution A->B sends a request and random number N1 B->A sends a response, encrypted with Ek(AB) including the new key KS || F(N1) ||IDB || N2 A-> B first verifies F(N1)IDB, then encrypts and sends F(N2) with the new KS B verifies that F(N2) has three central types A->KDC KDC->TA A->KDC KDC->TA TB A- >KDC KDC->A TA B TB A->KDC with random number N1 request







































A->KDC Timestamp TKDC lifetime L request




Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325391000&siteId=291194637