A client recently asked about the Dreamweaver STE format and retrieving a password from it. I’ve never done it, but a little research into the encryption format quickly provided a solution.

The password is basically in the form of number and letter which represent a series of hexadecimal numbers which have been modified a bit.

Let’s say the encrypted password is 70627576

It goes like:

  1. Each hexadecimal number is 2 digits, so “70627576″ would be 70, 62, 75 and 76
  2. Subtract the position of the number from itself, starting with 0.
    • 70 is in the 0 position, so subtract 0 from it
    • 62 is in the 1 position, so subtract 2 from it
    • 75 is in the 2 position, so subtract 3 from it
    • 76 is in the 3 position, so subtract 4 from it

    So, 70:62:75:76 becomes 70:61:73:73.

  3. Once done, convert each to ASCII.
    • 70 = ‘p’
    • 61 = ‘a’
    • 73 = ’s’
    • 73 = ’s’

    • So the password is ‘pass’

Now for the code to do this

  $encoded = "70627576";
  $letters = explode(' ', wordwrap($encoded, 2, ' ', 2));  
  $password = '';  
  for ($i = 0; $i < count($letters); $i++) {  
    $password .= chr(hexdec($letters[$i]) - $i);  
  }  
  echo $password;