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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:42:55+00:00 2026-05-24T00:42:55+00:00

I am currently developing an application in Delphi, in which I have to hide

  • 0

I am currently developing an application in Delphi, in which I have to hide (obfuscate) a string in source code like str := 'Example String'.
Why ? Because if I open the EXE in text editor and search for Example String I’ll find the string in second…

I tried to use a basic HEX transcription like #$65#$78#$61#$6d#$70#$6c#$65 but it’s re-transcribed in clear at compile time.
I looked for packers, but it’s not the best solution (PECompact can be detected as a false positive malware, UPX is too easy to de-UPX, …). I would prefer an idea in my internal code…

Someone would put me on the right way.

  • 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-24T00:42:56+00:00Added an answer on May 24, 2026 at 12:42 am

    A very simple method is to store the strings obfuscated by the ROT13 method.

    procedure ROT13(var Str: string);
    const
      OrdBigA = Ord('A');
      OrdBigZ = Ord('Z');
      OrdSmlA = Ord('a');
      OrdSmlZ = Ord('z');
    var
      i, o: integer;
    begin
      for i := 1 to length(Str) do
      begin
        o := Ord(Str[i]);
        if InRange(o, OrdBigA, OrdBigZ) then
          Str[i] := Chr(OrdBigA + (o - OrdBigA + 13) mod 26)
        else if InRange(o, OrdSmlA, OrdSmlZ) then
          Str[i] := Chr(OrdSmlA + (o - OrdSmlA + 13) mod 26);
      end;
    end;
    
    function ROT13fun(const Str: string): string;
    begin
      result := Str;
      ROT13(result);
    end;
    
    const
      ObfuscatedString = 'Guvf vf n frperg zrffntr.';
    
    procedure TForm4.FormCreate(Sender: TObject);
    begin
      ShowMessage(ROT13fun(ObfuscatedString));
    end;
    

    Slightly more sophisticated would be to employ the Caesar chipher or the Vigenère chipher.

    To obtain the obfuscated strings to use in the source code, you can use a decent text editor like my own Rejbrand Text Editor or Wolfram|Alpha.

    Update

    ROT13 is very easy to decipher, but it might be more than enough for your situation, depending on how it looks! At least it will become very hard to identify strings in the binary. It will take some real effort to obtain the strings. (After all, the every-day user don’t even look at binaries in a hex editor/text editor!) The Caesar cipher is a very simple generalisation of the ROT13 cipher, and is also easily deciphered. Indeed, there are only 25 different ‘passwords’. The Vigenère cipher is far trickier, and takes some really serious effort to crack (especially since you don’t know precisely where in the binary the strings are).

    As an example, below I give a string obfuscated using the Vigenère cihper:

    Xlc tsrgcdk sj ‘vrivem’ mw cei sd kli acirivqhfriw cw qsbsir tfmjmgw, rrh biimrk hyi pygk gilhlvc mf ws, wk leq rpws pvgsqc fj agrvwtvcou mrrsiiwx we izcfp-hew cmji, rpxlmixl ml r piqg xigfbzgep zrrkyyuv. Mlrvih, hyi qmrvvr qctmixw vbtpmwkw ilsikc qclvgiq ks wsqy er soxirr klex hyi ilhzvi cbmmvslavrx mt xli Srvxl wj irboekivcr. Mr hymw qstxmsl, ai uwcp mljvwxmeoki xfs tlcqwtep zojmw mt xli seivkw tsrgcdk.

    It would certainly be possible to extend the cipher to also take care of digits and special characters, including spaces. It could also be made to mix capitals and small letters. Then it would be terribly hard (although possible) to decipher. It is probably far easier to decipher if the password is a known word, which can be found in the dictionary. If it is not a word, it will be safer.

    The text above is obfuscated using a word that you can find in a large-enough dictionary. The text below is obfuscated using a nonsense string as password:

    Miwzvjfy m vjsy-tombox zguol ap ahqovz d uwk sbze w conz pe biusvth pagh h njsx. Io puvyeq, fl cjsx xic vmovdq zappzjvz, vnjnatl frcb vy dtmd vhxkt fto babtf davf. Uuxlhqb, khk aa dbn eumsuzq, auk saed vlpnbuuo ywlemz ue pnyl ttmxv. Pa ghof, fl cjsx kmbbzk atmd wv sfjtmxcl rtfysk cb yuta md jsy. Sqf nql njsx ly vs ilusrn o gok uxwupagupaz u.

    And, finally, the text below is obfuscated the same way, but – in addition – all spaces and special characters have been removed from the string:

    cishkclruervutzgnyarkgzjsaqgsrzvmmrzweolpcnvbkxrvdnqrlurhpmhfaxsuoqncxgzqegnqmngaryfbgozpcgrkgzrrybybmouyzbbkoucbnrnsxkmcbywpllxhkoobmzoydrfvrkhpvsavmzocwjflouboymlotjcnqrirgucdrftllladcwtmnkqehjpmnafoobyvkvdaancbzeokdnsotkkawvanjkryculluyaoklpnojfnqrlatypznpalzocjunuxzdbnzntpqulplekxhrshpttjqyculkkjyxhxgxdozruwlbtkyrsuumkgslbyunabbkryfupvnafobhuoyyvqjlzgzpomc

    I challenge you to decipher these three texts. If anyone would succeed in deciphering the last one, I promise to give this person 100 SEK (100 Swedish kronor)!

    But, still, Warren P is right: If you really require high security, that even the experts will not be able to decipher, then you should go for some real encryption.

    Update

    As requested by Warren P, I use the following code to encrypt/decrypt Vigenère:

    const
      OrdBigA = Ord('A');
      OrdBigZ = Ord('Z');
      OrdSmlA = Ord('a');
      OrdSmlZ = Ord('z');
    
    function imod(const x: integer; const y: integer): integer;
    begin
      if x >= 0 then
        imod := x - floor(x/y) * y
      else
        imod := x + ceil(-x/y) * y;
    end;
    
    procedure Vigenère(var Str: string; const Key: string);
    var
      n, i, o: integer;
      KeyChrs: TBytes;
    begin
    
      n := length(Key);
      SetLength(KeyChrs, n);
      for i := 1 to n do
        if InRange(ord(Key[i]), OrdBigA, OrdBigZ) then
          KeyChrs[i - 1] := Ord(Key[i]) - OrdBigA
        else
          raise Exception.Create('Invalid character in Vigenère key.');
    
      for i := 1 to length(Str) do
      begin
        o := Ord(Str[i]);
        if InRange(o, OrdBigA, OrdBigZ) then
          Str[i] := Chr(OrdBigA + imod((o - OrdBigA + KeyChrs[(i-1) mod n]), 26))
        else if InRange(o, OrdSmlA, OrdSmlZ) then
          Str[i] := Chr(OrdSmlA + imod((o - OrdSmlA + KeyChrs[(i-1) mod n]), 26));
      end;
    
    end;
    
    function Vigenèref(const Str: string; const Key: string): string;
    begin
      result := Str;
      Vigenère(result, Key);
    end;
    
    procedure VigenèreD(var Str: string; const Key: string);
    var
      n, i, o: integer;
      KeyChrs: TBytes;
    begin
    
      n := length(Key);
      SetLength(KeyChrs, n);
      for i := 1 to n do
        if InRange(ord(Key[i]), OrdBigA, OrdBigZ) then
          KeyChrs[i - 1] := Ord(Key[i]) - OrdBigA
        else
          raise Exception.Create('Invalid character in Vigenère key.');
    
      for i := 1 to length(Str) do
      begin
        o := Ord(Str[i]);
        if InRange(o, OrdBigA, OrdBigZ) then
          Str[i] := Chr(OrdBigA + imod((o - OrdBigA - KeyChrs[(i-1) mod n]), 26))
        else if InRange(o, OrdSmlA, OrdSmlZ) then
          Str[i] := Chr(OrdSmlA + imod((o - OrdSmlA - KeyChrs[(i-1) mod n]), 26));
      end;
    
    end;
    
    function VigenèreDf(const Str: string; const Key: string): string;
    begin
      result := Str;
      VigenèreD(result, Key);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing an application, which gets the input from a text file
I am currently developing an application which will require multiple different development languages. I
i would like to ask you for an advice. I'm currently developing application in
we're currently developing an application that makes extensive use of popup windows(*) and have
I'm currently developing a application where I will have multiple windows open using C#
I'm currently developing a web application and have run into a little problem. I'm
I'm currently developing a WPF application in C# and I want to have a
I'm currently developing an application in which I'm using a plugin system. For providing
I'm currently developing an application which uses the iTunes COM (Win32) to hook into
I'm currently developing a monitoring application for some in-house hardware using net-snmp. I have

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.