├── README.md ├── LICENSE └── Hashing ├── script.js ├── index.html └── style.css /README.md: -------------------------------------------------------------------------------- 1 | # Hash_generator 2 | the program generates SHA-1, SHA-256, SHA-512 hash algorithms 3 | 4 | 5 |

Hash Generator

6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Victor Preston 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Hashing/script.js: -------------------------------------------------------------------------------- 1 | function generateHash() { 2 | var inputText = document.getElementById("input-text").value; 3 | var hashAlgorithm = document.getElementById("hash-algorithm").value; 4 | var hashResult = document.getElementById("hash-result"); 5 | 6 | var hash; 7 | 8 | switch (hashAlgorithm) { 9 | case "sha1": 10 | hash = sha1(inputText); 11 | break; 12 | case "md5": 13 | hash = md5(inputText); 14 | break; 15 | case "md2": 16 | hash = md2(inputText); 17 | break; 18 | case "sha256": 19 | hash = sha256(inputText); 20 | break; 21 | case "sha512": 22 | hash = sha512(inputText); 23 | break; 24 | default: 25 | hash = "Invalid algorithm"; 26 | } 27 | 28 | hashResult.value = hash; 29 | } 30 | 31 | // SHA-1 hashing algorithm implementation 32 | function sha1(input) { 33 | var sha1Hash = CryptoJS.SHA1(input); 34 | return sha1Hash.toString(); 35 | } 36 | 37 | // MD5 hashing algorithm implementation 38 | function md5(input) { 39 | var md5Hash = CryptoJS.MD5(input); 40 | return md5Hash.toString(); 41 | } 42 | 43 | // MD2 hashing algorithm implementation 44 | function md2(input) { 45 | var md2Hash = CryptoJS.MD2(input); 46 | return md2Hash.toString(); 47 | } 48 | 49 | // SHA-256 hashing algorithm implementation 50 | function sha256(input) { 51 | var sha256Hash = CryptoJS.SHA256(input); 52 | return sha256Hash.toString(); 53 | } 54 | 55 | // SHA-512 hashing algorithm implementation 56 | function sha512(input) { 57 | var sha512Hash = CryptoJS.SHA512(input); 58 | return sha512Hash.toString(); 59 | } 60 | 61 | function clearHash() { 62 | document.getElementById("hash-result").value = ""; 63 | } -------------------------------------------------------------------------------- /Hashing/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Online Hash Generator 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Hash Generator

15 |
16 | 17 | 18 | 19 | 26 | 27 | 28 |
29 |
30 | 31 | 32 |
33 |
34 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /Hashing/style.css: -------------------------------------------------------------------------------- 1 | :root{ 2 | --main-background: #0b0c0f; 3 | --main-fonts-color: #fff; 4 | --main-decor-color:#00a9e2; 5 | --main-header-background:#21252e; 6 | --main-font-family: 'Poppins', sans-serif; 7 | } 8 | 9 | *{ 10 | margin: 0; 11 | padding: 0; 12 | scroll-behavior: smooth; 13 | } 14 | 15 | body { 16 | font-family: Arial, sans-serif; 17 | padding: 0; 18 | display: flex; 19 | flex-direction: column; 20 | align-items: center; 21 | height: 100vh; 22 | margin: 0; 23 | 24 | } 25 | nav { 26 | text-align:right; 27 | padding: 10px 0; 28 | width: 100%; 29 | 30 | } 31 | 32 | nav ul { 33 | list-style: none; 34 | padding: 0; 35 | display: flex; 36 | justify-content: flex-start; 37 | 38 | } 39 | 40 | nav li { 41 | display: inline-block; 42 | margin-right: 10px; 43 | } 44 | 45 | nav a { 46 | display: inline-block; 47 | padding: 10px 20px; 48 | background-color: #007bff; 49 | color: #fff; 50 | text-decoration: none; 51 | border-radius: 5px; 52 | } 53 | 54 | 55 | h1 { 56 | color: #333; 57 | align-items:center; 58 | justify-content: space-evenly; 59 | display: flex; 60 | } 61 | 62 | #input-form { 63 | margin-bottom: 20px; 64 | 65 | } 66 | 67 | label { 68 | display: block; 69 | margin-bottom: 5px; 70 | } 71 | 72 | input[type="text"] { 73 | width: 300px; 74 | padding: 5px; 75 | margin-bottom: 10px; 76 | } 77 | 78 | select { 79 | padding: 5px; 80 | margin-bottom: 10px; 81 | } 82 | 83 | button { 84 | padding: 5px 10px; 85 | } 86 | 87 | #output { 88 | padding: 10px; 89 | background-color: #f7f7f7; 90 | } 91 | 92 | textarea { 93 | width: 300px; 94 | height: 100px; 95 | resize: vertical; 96 | } 97 | 98 | .container { 99 | display: flex; 100 | flex-direction: column; 101 | align-items: center; 102 | justify-content: center; 103 | margin-top: 50px; 104 | } 105 | 106 | .hash-form { 107 | display: flex; 108 | flex-direction: column; 109 | align-items: center; 110 | margin-bottom: 20px; 111 | } 112 | 113 | .hash-input { 114 | margin-bottom: 10px; 115 | } 116 | 117 | .hash-output { 118 | margin-bottom: 10px; 119 | } 120 | 121 | .hash-buttons { 122 | display: flex; 123 | justify-content: center; 124 | } 125 | 126 | .hash-button { 127 | margin-right: 10px; 128 | } 129 | main{ 130 | position:relative; 131 | justify-content: space-around; 132 | } 133 | .bottom-footer { 134 | flex-direction: column; 135 | justify-items: center; 136 | align-items: center; 137 | padding: 1.5rem 0 0 0; 138 | margin-top: 2.5rem; 139 | position: relative; 140 | } 141 | 142 | .bottom-footer:before { 143 | content: ""; 144 | position: absolute; 145 | bottom: 0; 146 | width: 90%; 147 | max-width: 500px; 148 | height: 1px; 149 | background-color: #7b7b7b; 150 | left: 50%; 151 | transform: translate(-50%, -50%); 152 | } --------------------------------------------------------------------------------