Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions EncrypterDecrypterApp/M3hank/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EncrypterDecrypterApp</title>
<link rel="stylesheet" href="styles.css">
</head>

<body>
<div class="container">
<h2>EncrypterDecrypterApp</h2>
<textarea id="input" placeholder="Enter your text here..."></textarea>

<div class="buttons">
<button onclick="convert('encode', 'uri')">URL Encode</button>
<button onclick="convert('decode', 'uri')">URL Decode</button>
<button onclick="convert('encode', 'base64')">Base64 Encode</button>
<button onclick="convert('decode', 'base64')">Base64 Decode</button>
<button onclick="convert('encode', 'html')">HTML Entity Encode</button>
<button onclick="convert('decode', 'html')">HTML Entity Decode</button>
<button onclick="convert('encode', 'unicode')">Unicode Escape</button>
<button onclick="convert('decode', 'unicode')">Unicode Unescape</button>
<button onclick="convert('encode', 'hex')">Hex Encode</button>
<button onclick="convert('decode', 'hex')">Hex Decode</button>
<button onclick="convert('encode', 'binary')">Binary Encode</button>
<button onclick="convert('decode', 'binary')">Binary Decode</button>
</div>

<textarea id="output" readonly placeholder="Output will appear here..."></textarea>
<div class="author">
Made by M3hank
</div>
</body>
</html>
</div>
<script src="scripts.js"></script>
</body>

</html>
39 changes: 39 additions & 0 deletions EncrypterDecrypterApp/M3hank/scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* EncrypterDecrypterApp Script
* Author: M3hank
*/

function convert(type, method) {
const input = document.getElementById('input').value;
let output = '';

switch (method) {
case 'uri':
output = (type === 'encode') ? encodeURIComponent(input) : decodeURIComponent(input);
break;
case 'base64':
output = (type === 'encode') ? btoa(unescape(encodeURIComponent(input))) : decodeURIComponent(escape(atob(input)));
break;
case 'html':
const textArea = document.createElement('textarea');
if (type === 'encode') {
textArea.innerText = input;
output = textArea.innerHTML;
} else {
textArea.innerHTML = input;
output = textArea.value;
}
break;
case 'unicode':
output = (type === 'encode') ? input.split('').map(char => '\\u' + char.charCodeAt(0).toString(16).padStart(4, '0')).join('') : input.replace(/\\u([\d\w]{4})/gi, (match, grp) => String.fromCharCode(parseInt(grp, 16)));
break;
case 'hex':
output = (type === 'encode') ? Array.from(input).map(ch => ch.charCodeAt(0).toString(16)).join('') : String.fromCharCode(...input.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));
break;
case 'binary':
output = (type === 'encode') ? Array.from(input).map(ch => ch.charCodeAt(0).toString(2).padStart(8, '0')).join('') : String.fromCharCode(...input.match(/.{1,8}/g).map(byte => parseInt(byte, 2)));
break;
}

document.getElementById('output').value = output;
}
58 changes: 58 additions & 0 deletions EncrypterDecrypterApp/M3hank/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* EncrypterDecrypterApp
* Author: M3hank
*/

body {
font-family: 'Arial', sans-serif;
background-color: #f4f4f4;
padding: 40px;
}

.container {
background-color: #fff;
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
max-width: 600px;
margin: 0 auto;
}

.dropdown {
padding: 10px 15px;
border-radius: 5px;
border: 1px solid #e0e0e0;
width: 100%;
margin-bottom: 15px;
}

textarea {
width: 100%;
padding: 15px;
border-radius: 5px;
border: 1px solid #e0e0e0;
margin-bottom: 15px;
resize: vertical;
}

.btn {
background-color: #007bff;
color: #fff;
padding: 10px 15px;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}

.btn:hover {
background-color: #0056b3;
}

.author {
font-size: 1.2em;
text-align: center;
margin-top: 20px;
color: black;
font-weight: bold;
}