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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:46:57+00:00 2026-05-24T05:46:57+00:00

Is there a way to encrypt with XOR and represent in HEX (and the

  • 0

Is there a way to encrypt with XOR and represent in HEX (and the reverse). (I suppose not, couldn’t find that).

Is there an alternative? I don’t want to use Base64.

So I need to encrypt and represent the result in a readable form.

  • 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-24T05:46:58+00:00Added an answer on May 24, 2026 at 5:46 am

    Here is a function applying a XOR to a string, then return the result as hexadecimal:

    function XorToHex(const Source: string; Code: char): string;
    const
      HexChars: array[0..15] of char = '0123456789ABCDEF';
    var i: Integer;
        c: Integer;
    begin
      SetLength(Result,Length(Source)*(sizeof(char)*2));
      for i := 1 to Length(Source) do begin
        c := Ord(Source[i]) xor Ord(Code);
        {$IFDEF UNICODE}
        result[i*4-3] := HexChars[(c and 7) shr 4];
        result[i*4-2] := HexChars[(c and 7) and 15];
        c := c shr 8;
        result[i*4-1] := HexChars[c shr 4];
        result[i*4]   := HexChars[c and 15];
        {$ELSE}
        result[i*2-1] := HexChars[c shr 4];
        result[i*2]   := HexChars[c and 15];
        {$ENDIF}
      end;
    end;
    

    Such basic XOR is not strong at all. It’s very easy to guess the key code, which is only one Char.

    But this function will work with both Unicode and not Unicode strings.

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

Sidebar

Related Questions

Does anyone know do there have any way that I can encrypt the array
I'm making a program that has a login. Is there any way to encrypt
Is there an easy way to encrypt an SQL CE database that is provided
Is there an (easy) way to encrypt data so that it takes a certain
Is there a way to encrypt the data file that mysql uses? I have
Is there any way that I could encrypt the application context entries, for example:
Is there a way to encrypt or enclose my code on my Linux server
Is there any way to hide or encrypt JavaScript code to prevent people from
Is there a way to encrypt any string or file of any length and
Is there a way to encrypt the configuration file of a Windows forms application?

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.