video.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * video.php - The First Entry Point
  4. **/
  5. session_start();
  6. // Get Token
  7. $token = $_GET['vid'];
  8. // Get Current Session ID
  9. $prev = session_id();
  10. /*// Test the session variable token is set
  11. if (isset($_SESSION['setToken'])) {
  12. // This was a one time token and this is your security
  13. unset($_SESSION['setToken']);
  14. // Now we will re-encrypt the token
  15. $token = openssl_decrypt($token, "aes128", session_id(), 0, '1234567812345678');
  16. // Now Regenerate the session id
  17. session_regenerate_id();
  18. // Now re-encrypt the token with a key combination of both new and old ids
  19. $token = openssl_encrypt($token, "aes128", $prev . session_id(), 0, '1234567812345678');
  20. } else {
  21. // If token was not matched, we have changed the id therefore the next script will not be able to decrypt the token
  22. session_regenerate_id(true);
  23. }*/
  24. $token = str_replace(" ", "/", $token);
  25. /*$token_encrypted = openssl_encrypt($token, "DES-ECB", session_id());
  26. $token_decrypted = openssl_decrypt($token, "DES-ECB", session_id());
  27. echo ("now: " . $token);
  28. echo ("<br>");
  29. echo ("token_encrypted:" . $token_encrypted);
  30. echo ("<br>");
  31. echo ("token_decrypted:" . $token_decrypted);*/
  32. header("Location: access.php?id=" . $prev . "&vid=" . $token);