Skip to content

Commit

Permalink
Original first commit from 02-2013
Browse files Browse the repository at this point in the history
  • Loading branch information
aescanes committed Aug 18, 2023
1 parent 2e47bd0 commit 9f2550e
Show file tree
Hide file tree
Showing 15 changed files with 323 additions and 0 deletions.
82 changes: 82 additions & 0 deletions b64.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
var keyStr = "ABCDEFGHIJKLMNOP" +
"QRSTUVWXYZabcdef" +
"ghijklmnopqrstuv" +
"wxyz0123456789+/" +
"=";

function encode64(input) {
input = escape(input);
var output = "";
var chr1, chr2, chr3 = "";
var enc1, enc2, enc3, enc4 = "";
var i = 0;

do {
chr1 = input.charCodeAt(i++);
chr2 = input.charCodeAt(i++);
chr3 = input.charCodeAt(i++);

enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;

if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}

output = output +
keyStr.charAt(enc1) +
keyStr.charAt(enc2) +
keyStr.charAt(enc3) +
keyStr.charAt(enc4);
chr1 = chr2 = chr3 = "";
enc1 = enc2 = enc3 = enc4 = "";
} while (i < input.length);

return output;
}

function decode64(input) {
var output = "";
var chr1, chr2, chr3 = "";
var enc1, enc2, enc3, enc4 = "";
var i = 0;

// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
var base64test = /[^A-Za-z0-9\+\/\=]/g;
if (base64test.exec(input)) {
alert("There were invalid base64 characters in the input text.\n" +
"Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\n" +
"Expect errors in decoding.");
}
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

do {
enc1 = keyStr.indexOf(input.charAt(i++));
enc2 = keyStr.indexOf(input.charAt(i++));
enc3 = keyStr.indexOf(input.charAt(i++));
enc4 = keyStr.indexOf(input.charAt(i++));

chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;

output = output + String.fromCharCode(chr1);

if (enc3 != 64) {
output = output + String.fromCharCode(chr2);
}
if (enc4 != 64) {
output = output + String.fromCharCode(chr3);
}

chr1 = chr2 = chr3 = "";
enc1 = enc2 = enc3 = enc4 = "";

} while (i < input.length);

return unescape(output);
}
Binary file added delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lock128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lock16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lock19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lock48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "AE22 Encrypt",
"version": "1.0",
"manifest_version": 2,
"description": "The best extension to encrypt and decrypt plain text / La mejor extension para encriptar y desencriptar texto plano.",
"browser_action": {
"default_icon": "lock19.png",
"default_popup": "popup.html"
},
"icons": { "16": "lock16.png",
"48": "lock48.png",
"128": "lock128.png" }
}
9 changes: 9 additions & 0 deletions md5-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

140 changes: 140 additions & 0 deletions popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<!DOCTYPE html>
<html>
<head>
<title>Encrypt</title>
<style>
body {
color:black;
min-width:380px;
overflow-x:hidden;
font-family:"Comic Sans MS", cursive, sans-serif;
}

#content{
text-align:center;
}

#from{
border: 2px solid white;
-webkit-box-shadow:
inset 0 0 8px rgba(0,0,0,0.3),
0 0 16px rgba(0,0,0,0.3);
-moz-box-shadow:
inset 0 0 8px rgba(0,0,0,0.3),
0 0 16px rgba(0,0,0,0.3);
box-shadow:
inset 0 0 8px rgba(0,0,0,0.3),
0 0 16px rgba(0,0,0,0.3);
padding: 7px;
background: rgba(247,247,247,0.5);
width:300px;
font-family:"Comic Sans MS", cursive, sans-serif;
}

/* --------------- BOTONES --------------- */
.button, .button:visited { /* botones genéricos */
background: #222 url(http://sites.google.com/site/zavaletaster/Home/overlay.png) repeat-x;
display: inline-block;
padding: 5px 10px 6px;
color: #FFF;
text-decoration: none;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.6);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.6);
text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
border-top: 0px;
border-left: 0px;
border-right: 0px;
border-bottom: 1px solid rgba(0,0,0,0.25);
position: relative;
cursor:pointer;
}

button::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner {
border: none;
}

.button:hover { /* el efecto hover */
background-color: #111
color: #FFF;
}

.button:active{ /* el efecto click */
top: 1px;
}

/* botones medianos */
.button, .button:visited,.medium.button, .medium.button:visited {
font-size: 13px;
font-weight: bold;
line-height: 1;
text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
}

.orange.button, .orange.button:visited { background-color: #FF7413; }
.orange.button:hover{ background-color: #D45500; }

input.rounded {
border: 1px solid #ccc;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
-moz-box-shadow: 2px 2px 3px #666;
-webkit-box-shadow: 2px 2px 3px #666;
box-shadow: 2px 2px 3px #666;
font-size: 15px;
padding: 4px 7px;
outline: 0;
-webkit-appearance: none;
}
input.rounded:focus {
border-color: #339933;
}

#close{
vertical-align:middle;
margin-left:15px;
padding-bottom:5px;
}

#logo{
margin-bottom:-15px;
}

</style>

<!-- JavaScript and HTML must be in separate files for security. -->
<script src="popup.js"></script>
<script src="md5-min.js"></script>
<script src="sha1-min.js"></script>
<script src="sha256-min.js"></script>
<script src="sha512-min.js"></script>
<script src="ripemd160-min.js"></script>
<script src="b64.js"></script>
</head>
<body>
<div id="logo"><img src="title.png" /></div>
<div id="logo_ae"></div>

<div id="content">
<p><input type="text" value="" id="from" class="rounded" name="from" /><img id="close" src="delete.png" alt="Delete" title="Delete" /></p>
<p>
<button type="button" id="button_md5" class="button medium orange">MD5</button>
<button type="button" id="button_sha1" class="button medium orange">SHA-1</button>
<button type="button" id="button_sha256" class="button medium orange">SHA-256</button>
<button type="button" id="button_sha512" class="button medium orange">SHA-512</button>
<button type="button" id="button_ripemd160" class="button medium orange">RIPEMD160</button>
<br />
<button type="button" id="button_eb64" class="button medium orange">encode B64</button>
<button type="button" id="button_db64" class="button medium orange">decode B64</button>
</p>
<p><span id="dataFormatTo"></span></p>
</div>

</body>
</html>
42 changes: 42 additions & 0 deletions popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright (c) 2012 aescanes
// 2012/07/03

document.addEventListener('DOMContentLoaded', function () {
document.getElementById('close').addEventListener('click', cleanAll);
document.getElementById('button_md5').addEventListener('click', function(){convert('md5')});
document.getElementById('button_sha1').addEventListener('click', function(){convert('sha1')});
document.getElementById('button_sha256').addEventListener('click', function(){convert('sha256')});
document.getElementById('button_sha512').addEventListener('click', function(){convert('sha512')});
document.getElementById('button_ripemd160').addEventListener('click', function(){convert('ripemd160')});
document.getElementById('button_eb64').addEventListener('click', function(){convert('eb64')});
document.getElementById('button_db64').addEventListener('click', function(){convert('db64')});
});

function cleanAll() {
document.getElementById('from').value = '';
document.getElementById('dataFormatTo').textContent = '';
}

function convert(type) {
if(document.getElementById('from').value == ''){
document.getElementById('dataFormatTo').textContent = '';
return;
}
if(type == 'md5'){
var dataFromForm = hex_md5(document.getElementById('from').value);
}else if(type == 'sha1'){
var dataFromForm = hex_sha1(document.getElementById('from').value);
}else if(type == 'sha256'){
var dataFromForm = hex_sha256(document.getElementById('from').value);
}else if(type == 'sha512'){
var dataFromForm = hex_sha512(document.getElementById('from').value);
}else if(type == 'ripemd160'){
var dataFromForm = hex_rmd160(document.getElementById('from').value);
}else if(type == 'eb64'){
var dataFromForm = encode64(document.getElementById('from').value);
}else if(type == 'db64'){
var dataFromForm = decode64(document.getElementById('from').value);
}

document.getElementById('dataFormatTo').textContent = dataFromForm;
}
9 changes: 9 additions & 0 deletions ripemd160-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9f2550e

Please sign in to comment.