-1

How to create procedure a to decrypt a password reverse ASCII code multiple location char and concatenation with ASCII

example password: 123 encrypted to: 49491005015351

It's encrypted like this:

v := v || ASCII(substr(u_pass,i,1)) * instr(u_pass,substr(u_pass,i,1))
4

1 回答 1

0

反过来的问题是每个加密字符的长度可以变化。请注意,下面的算法寻找给出字符的最短序列。可能存在不正确的情况。在这些情况下,此代码将无法解密字符串的其余部分。

v := <encrypted password>;

i := 1;    -- Character
pos := 1;  -- Position in v
while (pos < length(v)) loop
  j=1;
  found = false;
  while not found  and j + pos <= length(v) loop
    if mod(to_number(substr(v, pos, j), i) = 0 then  
      -- Possible match
      anum := to_number(substr(v, pos, j)/ j;  -- ascii value of the next character
      alen := length(trim(to_char(anum)));
      if substr(v, pos + j, alen) = anum then
        -- Match found!
        u_pass := u_pass || chr(anum);
        found := true;
        pos := pos + j + alen;
        i := i + 1;
      end if;
    end if;
  end loop;
end loop;
于 2012-11-05T14:35:11.250 回答