Package anlavn.hash

Class MD5

java.lang.Object
anlavn.hash.MD5

@Deprecated public class MD5 extends Object
Deprecated.
The security of the MD5 hash function is severely compromised. A collision attack exists that can find collisions within seconds on a computer with a 2.6 GHz Pentium 4 processor (complexity of 224.1). Further, there is also a chosen-prefix collision attack that can produce a collision for two inputs with specified prefixes within seconds, using off-the-shelf computing hardware (complexity 239).
The MD5 class supports object and string encryption, decryption it is impossible. MD5 uses the Message-Digest algorithm 5 cryptographic hash function with a 128-bit long hash value.
Make sure your object class was "implements Serializable".
  • Constructor Details

    • MD5

      public MD5()
      Deprecated.
  • Method Details

    • encrypt

      public static final String encrypt(Object objToEncrypt)
      Deprecated.
      Use this method to encrypt the original object.
      Parameters:
      objToEncrypt - is the object need encrypt.
      Returns:
      a MD5 hash code of the original object.
    • encrypt

      public static final String encrypt(String strToEncrypt)
      Deprecated.
      Use this method to encrypt the original string.
      Parameters:
      strToEncrypt - is the string need encrypt.
      Returns:
      a MD5 hash code of the original string.