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 4018978
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:02:58+00:00 2026-05-20T10:02:58+00:00

OK, I have a 35 MB file, that is Encrypted with Bit to Bit

  • 0

OK, I have a 35 MB file, that is Encrypted with Bit to Bit XOR(Bitwise XOR I believe) and I’d like to know a good way to decrypt it, and then encrypt it again, using File I/O on C#.

Here is the Enc/Dec algorithm:

Encrypt:----------------------Decrypt:
Bit  0 -> Bit 26--------------Bit  0 -> Bit 18
Bit  1 -> Bit 31--------------Bit  1 -> Bit 29
Bit  2 -> Bit 17--------------Bit  2 -> Bit  7
Bit  3 -> Bit 10--------------Bit  3 -> Bit 25
Bit  4 -> Bit 30--------------Bit  4 -> Bit 15
Bit  5 -> Bit 16--------------Bit  5 -> Bit 31
Bit  6 -> Bit 24--------------Bit  6 -> Bit 22
Bit  7 -> Bit  2--------------Bit  7 -> Bit 27
Bit  8 -> Bit 29--------------Bit  8 -> Bit  9
Bit  9 -> Bit  8--------------Bit  9 -> Bit 26
Bit 10 -> Bit 20--------------Bit 10 -> Bit  3
Bit 11 -> Bit 15--------------Bit 11 -> Bit 13
Bit 12 -> Bit 28--------------Bit 12 -> Bit 19
Bit 13 -> Bit 11--------------Bit 13 -> Bit 14
Bit 14 -> Bit 13--------------Bit 14 -> Bit 20
Bit 15 -> Bit  4--------------Bit 15 -> Bit 11
Bit 16 -> Bit 19--------------Bit 16 -> Bit  5
Bit 17 -> Bit 23--------------Bit 17 -> Bit  2
Bit 18 -> Bit  0--------------Bit 18 -> Bit 23
Bit 19 -> Bit 12--------------Bit 19 -> Bit 16
Bit 20 -> Bit 14--------------Bit 20 -> Bit 10
Bit 21 -> Bit 27--------------Bit 21 -> Bit 24
Bit 22 -> Bit  6--------------Bit 22 -> Bit 28
Bit 23 -> Bit 18--------------Bit 23 -> Bit 17
Bit 24 -> Bit 21--------------Bit 24 -> Bit  6
Bit 25 -> Bit  3--------------Bit 25 -> Bit 30
Bit 26 -> Bit  9--------------Bit 26 -> Bit  0
Bit 27 -> Bit  7--------------Bit 27 -> Bit 21
Bit 28 -> Bit 22--------------Bit 28 -> Bit 12
Bit 29 -> Bit  1--------------Bit 29 -> Bit  8
Bit 30 -> Bit 25--------------Bit 30 -> Bit  4
Bit 31 -> Bit  5--------------Bit 31 -> Bit  1
  • 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-05-20T10:02:59+00:00Added an answer on May 20, 2026 at 10:02 am

    This isn’t a bitwise XOR – it’s effectively a bitwise substitution cypher. You realise it’s only “encryption” in the loosest sense of the word, right?

    Basically you’ll need two steps:

    • Write methods to transpose bits for encryption/decryption, each one taking a 32-bit integer and returning a 32-bit integer
    • Read the file one 32-bit integer at a time, apply the appropriate operation and write out the result to the other file. You may well want to use BinaryReader and BinaryWriter for this.

    (Obviously you can optimize with buffering, but that’s the general gist.)

    You may find it’s easiest to work with uint instead of int to avoid worrying about sign bits. Something like this:

    public static uint Encrypt(uint input)
    {
        return (((input >> 0) & 1) << 26) |
               (((input >> 1) & 1) << 31) |
               (((input >> 2) & 1) << 17) |
               ...
               (((input >> 31) & 1) << 5);
    }
    

    You could make this table-driven with a table for encryption and a table for decryption, but I’m not sure I’d bother.

    Note that if you’re actually using this to store sensitive information, you should start using real encryption as soon as possible.

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

Sidebar

Related Questions

I have a winform (in C#) that encrypt and decrypt a file... it's OK,
I have a pgp-encrypted file that I need to extract data from at runtime.
I have an aes encrypted mp3 file that I need to play in iOS;
Have been trying to encrypt an xml file to a string so that I
I have a file that looks like: 1 1 C C 1.9873 2.347 3.88776
I have a file that can be any thing like ZIP, RAR, txt, CSV,
I need to use a Delphi component to encrypt a file that can then
I have a file that was encrypted using AES. I use the following NSData
I have a csv file that required to be encrypted. I want to ask
I'm trying to decrypt a file in unmanaged C++ that was previously encrypted with

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.