Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8306675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:22:41+00:00 2026-06-08T18:22:41+00:00

Does anyone know how to decrypt the following encryption routine? Basically I have an

  • 0

Does anyone know how to decrypt the following encryption routine? Basically I have an encryption key, I enter it, then I am asked to enter a 6 letter word which then gets encrypted. How shall I decrypt this?
Thanks

encrypt:

      push edx 
      push ecx 
      not eax 
      add eax,0x04 
      mov edx,eax 
      pop eax 
      xor eax,edx 
      pop edx 
      rol al,1 
      rol al,1
      rol al,1 
      sub al,0x02 
      ret 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:22:43+00:00Added an answer on June 8, 2026 at 6:22 pm

    edit: for the new code, see bottom

    This code is weird, but it seems to be doing something like this: (not tested)

    char encrypt(char a, int c)
    {
        int t = 4 + ~a;        // the NOT and the ADD
        int t2 = (c ^ t) & 0xFF;  // the XOR
        int t3 = ((t2 << 3) | (t2 >> 5)) & 0xFF;  // the three ROL's
        return (char)(t3 - 2);   // the SUB
    }
    

    The corresponding decrypt would, I think, look like this: (not tested)

    char decrypt(char a, int c)
    {
        int t = (a + 2) & 0xFF;
        int t2 = ((t >> 3) | (t << 5)) & 0xFF;
        int t3 = t2 ^ c;
        return (char)~(t3 - 4);
    }
    

    Which in assembly could be this: (not tested, and no clutter)

    add al, 2
    ror al, 3   ; or three times ror al, 1
    xor al, cl
    sub al, 4
    not al
    ret
    

    Or you could do it in “mostly 32 bit”: (also not tested)

    add eax, 2
    ror al, 3
    xor eax, ecx
    sub eax, 4
    not eax
    movzx eax, al  ; or just ignore everything but the low byte
    ret
    

    Nothing at all was tested, but the general strategy I used is this: figure out what the code is doing, and then step by step think about how to undo these things, starting at the end. If there is a rotate left by 3, make a rotate right by 3. If they add 4, subtract 4. XOR and NOT are their own inverses.


    Because I got the key and the data mixed up I got it wrong. Actually, it should be this: (also not tested)

    ; eax = EKey, cl = char
    decryptB:
      add ecx, 2   // undo sub 2
      ror cl, 3    // undo rol
      not eax      // actually do not
      add eax, 4   // actually do add 4
      xor eax, ecx // undo xor
      ret
    

    Because the operations done on the key should not be the inverses.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know why UsernameExists wont return True. I must have my syntax messed
Does anyone know of a good way to encrypt and decrypt strings using VB6
Does anyone know why this php encrypt/decrypt is not working? We used this in
Does anyone know how to access the contacts from the Galaxy S? I have
Does anyone know if there is a way to generate different code in the
Does anyone know of a free tool, similar to what is built into Visual
Does anyone know of a mechanism in Sybase ASA 9 / Sybase SQL Anywhere
Does anyone know of any websites, or (preferably) downloadable packages that you can use
Does anyone know of a way to contain a nonbreaking space in an html
Does anyone know how to make entity_id visible on the frontend as a sortable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.