Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
inpp example in helpfile (encrypted) and max key length
#1
1)
In the helpfile: Mouse,, keys/text, dialogs >> inpp
mkAngryMSITStore:f:\portableapps\quickmacrosportable_dev\App\QuickMacros\qm2help.chm::/Functions/IDP_INPP.html

Macro m1
Code:
Copy      Help
;;Ask for password, and throw error if entered password is not "bnfg" (in code it is encrypted):
if(!inpp("[*E12073E7509E09F804*]" "" "" 1)) end "password incorrect"

I assume that "bnfg" is ecnrypted to

Code:
Copy      Help
E12073E7509E09F804

But what decrypt key is used to decrypt E12073E7509E09F804 back to "bnfg"? (Is it an internal QM key?)
I also assume that the [* and *] is to indicate that the content within is those characters [* and *] is encrypted? (or are those characters also part of the encrypted string "bnfg" ?


2)
For encryption I use Flag 1 and 8 => 1|8 (BlowFish+Hex)
Example below:

Macro m1
Code:
Copy      Help
str ss="STRING TO BE ENCRYPTED"
str encdec_key="WDF5GHHY66GMK12ZGBVMYWUZGAKTVNEZSIA1LS4FHVCPDA7FZMWCLI0N5NJPA7FOD3HEDSR" ;; key - encryption key. String of 1 to 56 characters length.
str encoded_string
str decoded_string
encoded_string.encrypt(1|8 ss encdec_key)

out encoded_string

decoded_string.decrypt(1|8 encoded_string encdec_key)

out decoded_string

In the helpfile:
mkAngryMSITStore:f:\portableapps\quickmacrosportable_dev\App\QuickMacros\qm2help.chm::/str/IDP_S_ENCRYPT.html
Quote:key - encryption key. String of 1 to 56 characters length.

But the key in my example code ("encdec_key") is larger ten 56 characters.
Why do I not get error?
Does QM automatically truncate/trim key to 56 chars if key is larger then 56 chars? (trim from left or right?).
#2
1. Yes, the key or whatever is internal. Yes, [**] means that E12073E7509E09F804 is an encrypted password.

2. Truncates from the right.
#3
Aah! that makes it clear!
Thank you!


Forum Jump:


Users browsing this thread: 1 Guest(s)