for (int ii = 0 ; ii < 200 ; ii++)
{
encrypt();
}
long start = System.currentTimeMillis();
for (int ii = 0 ; ii < 2000 ; ii++)
{
encrypt();
}
long elapsed = System.currentTimeMillis() - start;
for (int ii = 0 ; ii < 200 ; ii++)
{
decrypt();
}
long start = System.currentTimeMillis();
for (int ii = 0 ; ii < 2000 ; ii++)
{
decrypt();
}
long elapsed = System.currentTimeMillis() - start;
private void encrypt()
{
M = new BigInteger(64,random);
C = M.multiply(k).mod(N);
}
private void decrypt()
{
kk= k.modinverse(N);
Mp = kk.multiply(c).mod(N);
}
But I feel that the results are incorrect when run this program on netbeans platform.
Is there way to compare any two algorithm cryptography under execution time .
Is necessary decrypt algorithm take long time than encrypt algorithm?
Please any suggest.
No comments:
Post a Comment