Make Secret - Convert Password to stupid code

Started by kevin, February 17, 2021, 09:16:55 AM

Previous topic - Next topic

kevin

   Make Secret - Convert Password to stupid code

  Sometimes as programmers we have to include special keywords within our programs, unfortunately these keywords can be found but scanning through your compiled programs if stored as literal strings....   eg  print "MyPASSWORD"    - The text MyPASSWORD can be seen in the binary. 


  but....   what you could do is convert your special keywords / passwords to a chunk of code that generates the password (or whatever) and for the most part your golden.  


  The function bellow takes an input string and creates a series of basically dumb code to recreate the original string text from a seemingly unrelated integer values.  I'm not suggesting you use this exact method, rather, it's here to stimulate your programming imagination.    It's time to get freaky. 


PlayBASIC Code: [Select]
      MakeSecret("Hello World")
sync
waitkey

function MakeSecret(PassWord$)

for lp=1 to len(password$)
ThisChr=mid(Password$,lp)
Scaler=lp+rnd($10000)
result =((ThisChr-(17+lp))*Scaler)
offset = rnd(20000)
code$= "v="+str$(Scaler-offset)+ " : s$+=chr$(17+"+str$(lp)+"+ ("+str$(result)+"/(V+"+str$(Offset)+")))"
print code$
#print code$
next


EndFunction






   Example output from an input of HELLO WORLD



PlayBASIC Code: [Select]
v=7426 : s$+=chr$(17+1+ (679590/(V+5159)))
v=49248 : s$+=chr$(17+2+ (4884166/(V+10315)))
v=31667 : s$+=chr$(17+3+ (3525808/(V+8399)))
v=806 : s$+=chr$(17+4+ (1068882/(V+11480)))
v=42073 : s$+=chr$(17+5+ (4752778/(V+11329)))
v=-477 : s$+=chr$(17+6+ (70632/(V+8325)))
v=47706 : s$+=chr$(17+7+ (3077676/(V+1146)))
v=46838 : s$+=chr$(17+8+ (4611664/(V+6786)))
v=-2940 : s$+=chr$(17+9+ (568920/(V+9405)))
v=19486 : s$+=chr$(17+10+ (2571912/(V+12266)))
v=31432 : s$+=chr$(17+11+ (3176640/(V+12688)))

print s$