Jump to content
php.lv forumi

Iegūt šifrēšanas un atšifrēšanas laiku


djmartins

Recommended Posts

Labdien man ir jautājums, kā var iegūt šifrēšanas un atšifrēšanas laikus? Es vēlētos salīdzināt, kurš šifrēšanas algoritms ir ātrāks.

 

<?php
$key = "Labi, ka ir ta";
$input = "Ziema iet un aiziet";

$encrypted_data = mcrypt_ecb (MCRYPT_3DES, $key, $input, MCRYPT_ENCRYPT);
$result = mcrypt_ecb (MCRYPT_3DES, $key, $encrypted_data, MCRYPT_DECRYPT);
$encrypted_data2 = mcrypt_ecb (MCRYPT_AES, $key, $input, MCRYPT_ENCRYPT);
$result2 = mcrypt_ecb (MCRYPT_AES, $key, $encrypted_data2, MCRYPT_DECRYPT);



echo"$encrypted_data";
echo"<br>";
echo"$result";



?>

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...