Home  >  Q&A  >  body text

Is there any way to get one number after encrypting several sets of numbers that are not fixed in Java?

There may be three or four groups, but they are all numbers, and then a number can be obtained based on these three or four groups,

For example, if 12, 34, 10 are directly connected to 123410, the length may vary from factory to shorter. Is it similar to MD5 encryption, and the resulting length will be the same, but only numbers

ringa_leeringa_lee2681 days ago733

reply all(2)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-19 10:09:43

    The result of encryption is byte[], but it is converted into a hexadecimal string (or base64? This is not sure) by default.
    In fact, no matter what type, it is a number (byte) in the computer.
    Simple Rough, string getBytes and you can get the number

    reply
    0
  • ringa_lee

    ringa_lee2017-05-19 10:09:43

    Write a hash function yourself, for example, map the number to another number, such as 12345. Each number performs +3mod10 operation, which becomes 45678, and then XOR or AND each number in 45678. Operation, get a new number, and then how to fix the length, using a random algorithm, if the length is too long, randomly select a part of the value, if it is too short, add a random sequence. However, the above similar approach has flaws and lacks verification. It is not recommended to be used in actual projects, especially for database storage passwords.
    For actual projects, it is recommended to ask the company’s security personnel

    reply
    0
  • Cancelreply