Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- </head>
- <body>
- <form method="post" action="">
- <input type="username" name="username" placeholder="Enter email" /> <br>
- <input type="password" name="password" placeholder="Enter Password" />
- <button type="submit" name="submit">LOG IN</button>
- </form>
- <?php
- if(isset($_POST['submit']))
- {
- $username = (isset($_POST['username']) ? $_POST['username'] : '');
- $password = (isset($_POST['password']) ? $_POST['password'] : '');
- $encrypted = encryptIt( $password );
- $decrypted = decryptIt( $encrypted );
- echo $encrypted . '<br />' . $decrypted;
- function encryptIt( $q ) {
- $cryptKey = 'qJB0rGtIn5UB1xG03efyCp';
- $qEncoded = base64_encode( mcrypt_encrypt( MCRYPT_RIJNDAEL_256, md5( $cryptKey ), $q, MCRYPT_MODE_CBC, md5( md5( $cryptKey ) ) ) );
- return( $qEncoded );
- }
- function decryptIt( $q ) {
- $cryptKey = 'qJB0rGtIn5UB1xG03efyCp';
- $qDecoded = rtrim( mcrypt_decrypt( MCRYPT_RIJNDAEL_256, md5( $cryptKey ), base64_decode( $q ), MCRYPT_MODE_CBC, md5( md5( $cryptKey ) ) ), "