what is the matlab code for follwing equation
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
t=s^e(mod n)
u=m*m
c=(g^t)*r^m mod u
Antworten (1)
Walter Roberson
am 16 Apr. 2013
t = mod(s^e, n);
u = m*m;
c = mod((g^t) * r^m, u);
However! It is possible that the values you are working with, such as s^e, are going to (often) be too large to fit in 53 bits. If that is the case, then there are various number theory approaches that can be used to accurately calculate the mod. The details can depend upon whether s and n are mutually prime.
If you are working with cryptography or with prime numbers or with large numbers or with Galois Fields, or with CRCs, or with error-correcting polynomials, then you should probably not be using the straight-forward method I show above.
2 Kommentare
Siehe auch
Kategorien
Mehr zu Encryption / Cryptography finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!