この記事の例は、JavaにMD5暗号化を実装する方法を示しています。あなたの参照のために全員のためにそれを共有してください。特定の実装方法は次のとおりです。
java.security.security.nosuchalthmexception; 2 '3'、 '4'、 '5'、 '6'、 '7'、 '8'、 '9'、 'a'、 'b'、 'c'、 'd'、 'e'、 'e'、 'e'、 'e'、 'e'、 'e'、 'e'、 'e'、 'e'、 ' e '、' e '、' e '、' f '}; "md5");} / ** *これは、シングレットインスタンスを返します * / public static md5hashutil getInstance()throws nosuchalgorithmexception {if(md5 == null){md5 = new md5hashutil();} return(md5);} publi c c c c c c c publi c Static String Hashcode(datatohash)はnosuchalgorithmexception {return getinstance(); (byte [] datatohash){return hexstringfrombytes); ;} publ ic string hexstringfrombytes(byte [] b){string hex = "" "; int msb; int lsb = 0; int i; // msb maps for(i = 0; i <b.length; i ++){msb =((int)b [i]&0x000000ff) / 16; ;
たとえば、上記のコードはJava言語のMD5暗号化アルゴリズムを実装し、出力は暗号化後の暗号文です!
暗号化された暗号文は通常、データベースに保存されます。
同時に、MD5暗号化アルゴリズムは不可逆的であり、亀裂の難しさは非常に高くなりますが、使用するハードウェア環境は通常のコンピューターに匹敵しますまた、MD5を割った
この記事がすべての人のJavaプログラムのデザインに役立つことが期待されています。