-
Notifications
You must be signed in to change notification settings - Fork 0
/
encriptador.js
31 lines (24 loc) · 1.16 KB
/
encriptador.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function encriptar(){
const frase_original = document.querySelector(".fraseOri").value;
const frase_encriptada = frase_original.replace(/e/gi, "eXt0N@").replace(/i/gi, "iZlP5").replace(/a/gi, "a-9 TbS&8").replace(/o/gi, "o@Lm Jh65%").replace(/u/gi, "uZg1 K5Hdc");
document.querySelector(".fraseEnc").value = frase_encriptada;
document.querySelector(".fraseEnc").value;
}
boton1 = document.querySelector("#encriptar");
boton1.onclick = encriptar;
function desencriptar(){
const frase_original = document.querySelector(".fraseOri").value;
const frase_encriptada = frase_original.replace(/eXt0N@/gi, "e").replace(/iZlP5/gi, "i").replace(/a-9 TbS&8/gi, "a").replace(/o@Lm Jh65%/gi, "o").replace(/uZg1 K5Hdc/gi, "u");
document.querySelector(".fraseEnc").value = frase_encriptada;
document.querySelector(".fraseEnc").value;
}
boton2 = document.querySelector("#desencriptar");
boton2.onclick = desencriptar;
function copiar(){
let texto = document.getElementById("fraseEncriptada")
texto.select();
texto.setSelectionRange(0, 999999);
document.execCommand('copy');
}
boton3 = document.querySelector("#copiar");
boton3.onclick = copiar;