Author Topic: Encrypt/decrypt given string  (Read 11150 times)

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Encrypt/decrypt given string
« Reply #15 on: June 22, 2006, 10:40:40 AM »
You may want to do 2 pass encoding: First pass does simple xor encoding, second pass ensures output will survive to/from the registry (not sure if the registry will support low order (control codes, < 32) or extended ascii (> 127), the frequent product of simple xoring methods).

One common method for ensuring the latter is base16|32|64 encoding which typically encodes to a limited (printable ascii) character set, let me know if you want sample lisp code to do base encoding.

Example:

(setq
    text "Welcome to theswamp.org"
    mask "Actually, I was talking to the duck."
)   

(xortext text mask)

"\026\006\030\026\016\001\tYXOiT\037\004\000W\025\014\034E\006\034\000"

(tobase64 (xortext text mask))

"4VNN4Vs01K_NIq_J6kF-KlJB63J56--"

(xortext (frombase64 (tobase64 (xortext text mask))) mask)

"Welcome to theswamp.org"

Encryption is a vast topic that one could dedicate one's entire career to. Before committing to a solution you consider interogating the usual suspects, wikipedia.org, answers.com ...
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

matrix2005in

  • Guest
Re: Encrypt/decrypt given string
« Reply #16 on: June 22, 2006, 11:10:20 AM »
wow interesting subject...but very complicated...well i will look into it
thanks...

actually my problem is now i gota different encryption methods with me..with the help of Evgeniy
i am able to do encrypt/decrypt as i want...upto this point now i am ok...now what my next move is i want to put encrypted values to registry...i know this simple code...
Code: [Select]
(vl-registry-write ""HKEY_CURRENT_USER\\Myapp" "app" "test data")but this doesnt work here...i dont know what to do next  :-(

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Encrypt/decrypt given string
« Reply #17 on: June 22, 2006, 11:40:35 AM »
>matrix2005in
You note a guard for yours programs?

matrix2005in

  • Guest
Re: Encrypt/decrypt given string
« Reply #18 on: June 22, 2006, 11:56:25 AM »
well i am

what ever you are mensioned here is just a methed for me and i am not talking your entire stuff..say a portion..you know i am learning...you people are masters..and very good in lisp...i am just a beginner gotta lotsa ideas..but i am not getting the proper syntax/function to write it down :-(




ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Encrypt/decrypt given string
« Reply #19 on: June 22, 2006, 12:08:08 PM »
well i am

what ever you are mensioned here is just a methed for me and i am not talking your entire stuff..say a portion..you know i am learning...you people are masters..and very good in lisp...i am just a beginner gotta lotsa ideas..but i am not getting the proper syntax/function to write it down :-(





(vl-registry-write ""HKEY_CURRENT_USER\\Myapp" "app" "test data")
=>
(vl-registry-write "HKEY_CURRENT_USER\\Myapp" "app" "test data")
For me, worked!


ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Encrypt/decrypt given string
« Reply #20 on: June 22, 2006, 12:28:30 PM »
> matrix2005in

Probably, you have not understood me...
I wanted to you help, but not knowing, that you make, it is difficult for me. :(
Knowing your purpose, I can direct better and more easy you, for me will be more hints!

I have written crypt/decrypt - it was interesting to me - never was occupied with such programs.
Now for you a problem on simple function. (F1)

matrix2005in

  • Guest
Re: Encrypt/decrypt given string
« Reply #21 on: June 22, 2006, 01:53:25 PM »
hi Evgeniy

i am really sorry for what ever confusion is created here...you helped me a lot that's true....

i will clear myself....

what i want is put a encrypted data in registry as well as in file..so when i call from another function   both  should return the same value...i know this for you is very simple...what i thought in the beginning if i will get a code for encrypt/decrypt then will do the rest myself...i failed and that's where the confusion created.... :-(

(vl-registry-write "HKEY_CURRENT_USER\\Myapp" "app" "test data")
This Will create a registry entry in HKEY_CURRENT_USER and the value of that is - test data
........in-spite of "test data" i want to put encrypted value there....

Evgeniy you are a good programmer... i am try to learn from you...


thanks

mathew

Bob Wahr

  • Guest
Re: Encrypt/decrypt given string
« Reply #22 on: June 22, 2006, 02:31:45 PM »
Matrix, I am going to throw out a caution for you.  You should really be careful about writing to the registry except where absolutely necessary.  The last thing that you want to do is corrupt your (or worse someone else's) registry.

matrix2005in

  • Guest
Re: Encrypt/decrypt given string
« Reply #23 on: June 23, 2006, 04:18:06 PM »
hi

i am ok with windows registry...if anything happens i can roll it back

well my problem is using above encryption method..i cannot directly decrypt from file ....and if some modifications done with the encrypted file..this wont show up using decript method..what to do???

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Encrypt/decrypt given string
« Reply #24 on: June 23, 2006, 05:57:16 PM »
I advise, use as a key - one of programs.
Write all programs through EVAL and cipher them. Then with compile!
I did not try, but should work...
If each program will use as a key - different parts of one of programs and at install all will be crypt/decrypt under unique number of a computer - very high degree of protection should turn out!
To decrypt a code, I offer during execution of the program then to crack it is necessary each function is very difficultly!

Peter2

  • Swamp Rat
  • Posts: 650
Re: Encrypt/decrypt given string
« Reply #25 on: October 09, 2013, 05:25:44 AM »
Hi

it's interesting that this threads was calm for now seven years ...

I'm searching and reading and testing - and have a question:
Is the code from Evgeniy related to
https://en.wikipedia.org/wiki/One-time_pad ??
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Encrypt/decrypt given string
« Reply #26 on: October 09, 2013, 07:48:29 AM »
 :-)