Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Encryption & Decryption</title>
- </head>
- <body>
- <form action="" method="POST">
- <textarea name="input" cols="30" rows="8"></textarea>
- <br>
- <input type="submit" name="submit" value="Encrypt!" />
- </form>
- <?php
- if(isset($_POST['submit'])) {
- $input = $_POST['input'];
- $key = array(
- 'a' => '?',
- 'i' => '$',
- 'u' => '^',
- 'e' => '#',
- 'o' => '+',
- ' ' => 'zZ',
- 'A' => '!',
- 'I' => '%',
- 'U' => '_',
- 'E' => '=',
- 'O' => '*'
- );
- $key2 = array(
- '?' => 'a',
- '$' => 'i',
- '^' => 'u',
- '#' => 'e',
- '+' => 'o',
- 'zZ' => ' ',
- '!' => 'A',
- '%' => 'I',
- '_' => 'U',
- '=' => 'E',
- '*' => 'O'
- );
- $enkripsi = str_replace(array_keys($key), $key, $input);
- $dekripsi = str_replace(array_keys($key2), $key2, $enkripsi);
- echo 'Encryption : '.$enkripsi;
- echo '<br>';
- echo 'Decryption : '.$dekripsi;
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement