• 两个MD5值一样的 128 byte sequences


    d131dd02c5e6eec4693d9a0698aff95c 2fcab58712467eab4004583eb8fb7f89 
    55ad340609f4b30283e488832571415a 085125e8f7cdc99fd91dbdf280373c5b 
    d8823e3156348f5bae6dacd436c919c6 dd53e2b487da03fd02396306d248cda0 
    e99f33420f577ee8ce54b67080a80d1e c69821bcb6a8839396f9652b6ff72a70
    
    d131dd02c5e6eec4693d9a0698aff95c 2fcab50712467eab4004583eb8fb7f89 
    55ad340609f4b30283e4888325f1415a 085125e8f7cdc99fd91dbd7280373c5b 
    d8823e3156348f5bae6dacd436c919c6 dd53e23487da03fd02396306d248cda0 
    e99f33420f577ee8ce54b67080280d1e c69821bcb6a8839396f965ab6ff72a70
    

    C# 示例

    > var md5 = System.Security.Cryptography.MD5.Create();
    > Console.WriteLine(BitConverter.ToString(md5.ComputeHash(strToToHexByte("d131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab4004583eb8fb7f8955ad340609f4b30283e488832571415a085125e8f7cdc99fd91dbdf280373c5bd8823e3156348f5bae6dacd436c919c6dd53e2b487da03fd02396306d248cda0e99f33420f577ee8ce54b67080a80d1ec69821bcb6a8839396f9652b6ff72a70"))).Replace("-", string.Empty));
    79054025255FB1A26E4BC422AEF54EB4
    > Console.WriteLine(BitConverter.ToString(md5.ComputeHash(strToToHexByte("d131dd02c5e6eec4693d9a0698aff95c2fcab50712467eab4004583eb8fb7f8955ad340609f4b30283e4888325f1415a085125e8f7cdc99fd91dbd7280373c5bd8823e3156348f5bae6dacd436c919c6dd53e23487da03fd02396306d248cda0e99f33420f577ee8ce54b67080280d1ec69821bcb6a8839396f965ab6ff72a70"))).Replace("-", string.Empty));
    79054025255FB1A26E4BC422AEF54EB4
    
    private static byte[] strToToHexByte(string hexString)
    {
         hexString = hexString.Replace(" ", "");
         if ((hexString.Length % 2) != 0)
             hexString += " ";
         byte[] returnBytes = new byte[hexString.Length / 2];
         for (int i = 0; i < returnBytes.Length; i++)
             returnBytes[i] = Convert.ToByte(hexString.Substring(i * 2, 2), 16);
         return returnBytes;
    }
    

    写入文本

    > File.WriteAllBytes("D:/1.txt", strToToHexByte("d131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab4004583eb8fb7f8955ad340609f4b30283e488832571415a085125e8f7cdc99fd91dbdf280373c5bd8823e3156348f5bae6dacd436c919c6dd53e2b487da03fd02396306d248cda0e99f33420f577ee8ce54b67080a80d1ec69821bcb6a8839396f9652b6ff72a70"));
    > File.WriteAllBytes("D:/2.txt", strToToHexByte("d131dd02c5e6eec4693d9a0698aff95c2fcab50712467eab4004583eb8fb7f8955ad340609f4b30283e4888325f1415a085125e8f7cdc99fd91dbd7280373c5bd8823e3156348f5bae6dacd436c919c6dd53e23487da03fd02396306d248cda0e99f33420f577ee8ce54b67080280d1ec69821bcb6a8839396f965ab6ff72a70"));
    > 
    

    参考:
    https://stackoverflow.com/questions/933497/create-your-own-md5-collisions

  • 相关阅读:
    HDU 3681 Prison Break(状态压缩dp + BFS)
    POJ 2711 Regular Words(DP + 高精度)
    ZOJ 2745 01-K Code(DP)(转)
    DAG模型——硬币问题
    HDU 1619 Unidirectional TSP(单向TSP + 路径打印)
    DAG模型——嵌套矩阵
    HDU 4294 A Famous Equation(DP)
    HDU 3920 Clear All of Them I(DP + 状态压缩 + 贪心)
    POJ 3254 Corn Fields(DP + 状态压缩)
    HDU 2089 不要62(数位DP)
  • 原文地址:https://www.cnblogs.com/chasingdreams2017/p/13930117.html
Copyright © 2020-2023  润新知