Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| espace-dev:convertisseur-md5 [27/04/2023 02:06] – supprimée - modification externe (Date inconnue) 127.0.0.1 | espace-dev:convertisseur-md5 [12/01/2024 21:00] (Version actuelle) – [Le md5] suppression balise test zonewebmaster | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | {{htmlmetatags> | ||
| + | metatag-og: | ||
| + | metatag-og: | ||
| + | metatag-og: | ||
| + | metatag-og: | ||
| + | metatag-og: | ||
| + | metatag-og: | ||
| + | metatag-og: | ||
| + | metatag-article: | ||
| + | metatag-article: | ||
| + | metatag-article: | ||
| + | metatag-article: | ||
| + | }} | ||
| + | ====== Convertisseur MD5 ====== | ||
| + | |||
| + | Les // | ||
| + | |||
| + | ===== Le md5 ===== | ||
| + | |||
| + | Le **MD5**, pour **Message Digest 5**, est une fonction de hachage cryptographique qui permet d' | ||
| + | |||
| + | |||
| + | ===== Le convertisseur en MD5 ===== | ||
| + | |||
| + | Il vous suffit de remplir le champs " | ||
| + | |||
| + | < | ||
| + | <div style=" | ||
| + | <div class=" | ||
| + | <label for=" | ||
| + | <input type=" | ||
| + | </ | ||
| + | <div class=" | ||
| + | <label for=" | ||
| + | < | ||
| + | </ | ||
| + | <div class=" | ||
| + | <input type=" | ||
| + | </ | ||
| + | <div class=" | ||
| + | <input type=" | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | |||
| + | var MD5 = function (string) { | ||
| + | function RotateLeft(lValue, | ||
| + | return (lValue<< | ||
| + | } | ||
| + | function AddUnsigned(lX, | ||
| + | var lX4, | ||
| + | lX8 = (lX & 0x80000000); | ||
| + | lY8 = (lY & 0x80000000); | ||
| + | lX4 = (lX & 0x40000000); | ||
| + | lY4 = (lY & 0x40000000); | ||
| + | lResult = (lX & 0x3FFFFFFF)+(lY & 0x3FFFFFFF); | ||
| + | if (lX4 & lY4) { | ||
| + | return (lResult ^ 0x80000000 ^ lX8 ^ lY8); | ||
| + | } | ||
| + | if (lX4 | lY4) { | ||
| + | if (lResult & 0x40000000) { | ||
| + | return (lResult ^ 0xC0000000 ^ lX8 ^ lY8); | ||
| + | } else { | ||
| + | return (lResult ^ 0x40000000 ^ lX8 ^ lY8); | ||
| + | } | ||
| + | } else { | ||
| + | return (lResult ^ lX8 ^ lY8); | ||
| + | } | ||
| + | } | ||
| + | function F(x,y,z) { return (x & y) | ((~x) & z); } | ||
| + | function G(x,y,z) { return (x & z) | (y & (~z)); } | ||
| + | function H(x,y,z) { return (x ^ y ^ z); } | ||
| + | function I(x,y,z) { return (y ^ (x | (~z))); } | ||
| + | function FF(a, | ||
| + | a = AddUnsigned(a, | ||
| + | return AddUnsigned(RotateLeft(a, | ||
| + | }; | ||
| + | function GG(a, | ||
| + | a = AddUnsigned(a, | ||
| + | return AddUnsigned(RotateLeft(a, | ||
| + | }; | ||
| + | function HH(a, | ||
| + | a = AddUnsigned(a, | ||
| + | return AddUnsigned(RotateLeft(a, | ||
| + | }; | ||
| + | function II(a, | ||
| + | a = AddUnsigned(a, | ||
| + | return AddUnsigned(RotateLeft(a, | ||
| + | }; | ||
| + | function ConvertToWordArray(string) { | ||
| + | var lWordCount; | ||
| + | var lMessageLength = string.length; | ||
| + | var lNumberOfWords_temp1=lMessageLength + 8; | ||
| + | var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1 % 64))/64; | ||
| + | var lNumberOfWords = (lNumberOfWords_temp2+1)*16; | ||
| + | var lWordArray=Array(lNumberOfWords-1); | ||
| + | var lBytePosition = 0; | ||
| + | var lByteCount = 0; | ||
| + | while ( lByteCount < lMessageLength ) { | ||
| + | lWordCount = (lByteCount-(lByteCount % 4))/4; | ||
| + | lBytePosition = (lByteCount % 4)*8; | ||
| + | lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount)<< | ||
| + | lByteCount++; | ||
| + | } | ||
| + | lWordCount = (lByteCount-(lByteCount % 4))/4; | ||
| + | lBytePosition = (lByteCount % 4)*8; | ||
| + | lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80<< | ||
| + | lWordArray[lNumberOfWords-2] = lMessageLength<< | ||
| + | lWordArray[lNumberOfWords-1] = lMessageLength>>> | ||
| + | return lWordArray; | ||
| + | }; | ||
| + | function WordToHex(lValue) { | ||
| + | var WordToHexValue="", | ||
| + | for (lCount = 0; | ||
| + | lByte = (lValue>>> | ||
| + | WordToHexValue_temp = " | ||
| + | WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2, | ||
| + | } | ||
| + | return WordToHexValue; | ||
| + | }; | ||
| + | function Utf8Encode(string) { | ||
| + | string = string.replace(/ | ||
| + | var utftext = ""; | ||
| + | for (var n = 0; n < string.length; | ||
| + | var c = string.charCodeAt(n); | ||
| + | if (c < 128) { | ||
| + | utftext += String.fromCharCode(c); | ||
| + | } | ||
| + | else if((c > 127) && (c < 2048)) { | ||
| + | utftext += String.fromCharCode((c >> 6) | 192); | ||
| + | utftext += String.fromCharCode((c & 63) | 128); | ||
| + | } | ||
| + | else { | ||
| + | utftext += String.fromCharCode((c >> 12) | 224); | ||
| + | utftext += String.fromCharCode(((c >> 6) & 63) | 128); | ||
| + | utftext += String.fromCharCode((c & 63) | 128); | ||
| + | } | ||
| + | } | ||
| + | return utftext; | ||
| + | }; | ||
| + | var x=Array(); | ||
| + | var k, | ||
| + | var S11=7, S12=12, S13=17, S14=22; | ||
| + | var S21=5, S22=9 , S23=14, S24=20; | ||
| + | var S31=4, S32=11, S33=16, S34=23; | ||
| + | var S41=6, S42=10, S43=15, S44=21; | ||
| + | string = Utf8Encode(string); | ||
| + | x = ConvertToWordArray(string); | ||
| + | a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476; | ||
| + | for (k=0; | ||
| + | AA=a; BB=b; CC=c; DD=d; | ||
| + | a=FF(a, | ||
| + | d=FF(d, | ||
| + | c=FF(c, | ||
| + | b=FF(b, | ||
| + | a=FF(a, | ||
| + | d=FF(d, | ||
| + | c=FF(c, | ||
| + | b=FF(b, | ||
| + | a=FF(a, | ||
| + | d=FF(d, | ||
| + | c=FF(c, | ||
| + | b=FF(b, | ||
| + | a=FF(a, | ||
| + | d=FF(d, | ||
| + | c=FF(c, | ||
| + | b=FF(b, | ||
| + | a=GG(a, | ||
| + | d=GG(d, | ||
| + | c=GG(c, | ||
| + | b=GG(b, | ||
| + | a=GG(a, | ||
| + | d=GG(d, | ||
| + | c=GG(c, | ||
| + | b=GG(b, | ||
| + | a=GG(a, | ||
| + | d=GG(d, | ||
| + | c=GG(c, | ||
| + | b=GG(b, | ||
| + | a=GG(a, | ||
| + | d=GG(d, | ||
| + | c=GG(c, | ||
| + | b=GG(b, | ||
| + | a=HH(a, | ||
| + | d=HH(d, | ||
| + | c=HH(c, | ||
| + | b=HH(b, | ||
| + | a=HH(a, | ||
| + | d=HH(d, | ||
| + | c=HH(c, | ||
| + | b=HH(b, | ||
| + | a=HH(a, | ||
| + | d=HH(d, | ||
| + | c=HH(c, | ||
| + | b=HH(b, | ||
| + | a=HH(a, | ||
| + | d=HH(d, | ||
| + | c=HH(c, | ||
| + | b=HH(b, | ||
| + | a=II(a, | ||
| + | d=II(d, | ||
| + | c=II(c, | ||
| + | b=II(b, | ||
| + | a=II(a, | ||
| + | d=II(d, | ||
| + | c=II(c, | ||
| + | b=II(b, | ||
| + | a=II(a, | ||
| + | d=II(d, | ||
| + | c=II(c, | ||
| + | b=II(b, | ||
| + | a=II(a, | ||
| + | d=II(d, | ||
| + | c=II(c, | ||
| + | b=II(b, | ||
| + | a=AddUnsigned(a, | ||
| + | b=AddUnsigned(b, | ||
| + | c=AddUnsigned(c, | ||
| + | d=AddUnsigned(d, | ||
| + | } | ||
| + | var temp = WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d); | ||
| + | return temp.toLowerCase(); | ||
| + | } | ||
| + | function afficher(){ | ||
| + | var saisie =document.getElementById(" | ||
| + | document.getElementById(" | ||
| + | } | ||
| + | function copy() { | ||
| + | var copyText = document.querySelector("# | ||
| + | copyText.select(); | ||
| + | document.execCommand(" | ||
| + | } | ||
| + | |||
| + | document.querySelector("# | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | ===== Notes de version ===== | ||
| + | |||
| + | * [13/ | ||
| + | * [11/ | ||
| + | |||
| + | |||
| + | ===== Auteurs et sources ===== | ||
| + | |||
| + | * Auteur : [[: | ||
| + | |||
| + | ===== Navigation ===== | ||
| + | |||
| + | {{page>: | ||
| + | |||
| + | <nspages -h1 -exclude: | ||
| + | |||