Skip to content

Instantly share code, notes, and snippets.

@CristhianMotoche
Created September 30, 2016 03:20
Show Gist options
  • Save CristhianMotoche/0bfd6b38f3f8317723265947f380fa63 to your computer and use it in GitHub Desktop.
Save CristhianMotoche/0bfd6b38f3f8317723265947f380fa63 to your computer and use it in GitHub Desktop.
Uso de bibliotecas especializadas para cifrar una contraseña en base a algún algoritmo.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Crifrar</title>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js"></script>
<script>
function cifrar(word){
hash = CryptoJS.MD5(word);
document.getElementById("pass").innerHTML = hash;
}
</script>
</head>
<body>
<input type="password" id="entrada">
<button onclick="cifrar(document.getElementById('entrada').value)">¡Cifra tu contraseña!</button>
<p id="pass" type="password"></p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment