baskaran.vishnu
22nd June 2006 11:47 UTC
NSIS XOR Logic Operation
Hello;
I am keen in knowing if NSIS supports any basic XOR logic operations.
The installer I am preparing requires the user to input a PIN Code that would be then copied into the registry.
However, I was hoping of any possible way to perform an encryption feature such as a simple XOR to protect the identity of the PIN Code as stored into registry.
The installed application would then read the encrypted string from the registry and perform an XOR operation to retrieve the original string value.
Hence, if there are any means of performing a XOR operation in NSIS or any equivalent encryption procedure for a string variable, I would be grateful for any feedbacks on this issue.
Thank you very much.
glory_man
22nd June 2006 12:12 UTC
See
4.9.10.2 IntOp
user_var(output) value1 OP [value2]
Combines value1 and (depending on OP) value2 into the user variable $x. OP is defined as one of the following:
...
^ BINARY XORs value1 and value2
...
hope this help.
baskaran.vishnu
23rd June 2006 02:38 UTC
Hello;
Thanks very much for the guide.
The IntOp for the Binary XOR operation works perfect for Integer Numbers.
However, if a string with a mixture of numbers and characters, the IntOp feature would not work. It only works for numbers (0-9).
Is there anyway to perform a simple XOR for string variables?
For instance, I have a variable $Key1 with an assigned string '12*#34'. I have a second variable $Key2 with an assigned string '123456'. Are there any functions or methods in NSIS that could perform a basic XOR between these variables?
If $Key1 above is of type number only, then I am sure the IntOp XOR feature would definitely work. However, the input specified into $Key1 could consist of a combination of number and characters (e.g. # *)
Would be grateful for any help on this issue.
Thanks.
galil
23rd June 2006 08:00 UTC
Use Math plugin.