Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to encrypt the password field in the command line
#1
Hello everyone, I am using QM to run the command line to back up my system. There is a field in the command line to set the password. I want to encrypt the plaintext password in QM. How do I need to write the code? Thanks in advance.

 -pwd=mypwd    (My password is  mypwd)


Macro Macro1
Code:
Copy      Help
opt waitmsg 1
int exitCode1=run("$qm$\Ghost64.exe" "-clone,mode=pdump,src=1:1,dst=E:\Back.GHO -z9 -sure -pwd=mypwd" "" "" 16|0x400); err
mes "Backup is ok"
#2
Macro Macro37
Code:
Copy      Help
str encryption_decryption_key="this_is_the_password"
str ss="TEST 123" ;; The string to be encrypted (password for the ghost command line)

str ss_encrypted.encrypt(1|8 ss encryption_decryption_key)
out ss_encrypted ;; 6600915583585BD5 , this is the encrypted state of 'TEST 123'

str ss_decrypted.decrypt(1|8 ss_encrypted encryption_decryption_key)
out ss_decrypted ;; 'TEST 123' ,  this is the decrypted state of '6600915583585BD5' (used as password below in ghost command-line)

opt waitmsg 1

int exitCode1=run("''$qm$\Ghost64.exe''" F"-clone,mode=pdump,src=1:1,dst=''E:\Back.GHO'' -z9 -sure -pwd={ss_decrypted}" "" "" 16|0x400); err
mes "Backup is ok"

;; Paths in commandline are double quoted. Try to make a habit of it.
;; Copy and paste this code in QM and within the code
;; put cursor within the blue 'encrypt' OR 'decrypt' then press [F1]
#3
thank you very much for your help

I still have a few questions, in the picture below,

1.Some people will find the password in the blue rectangle?

2.Is the red underline necessary to delete?


Attached Files Image(s)
   
#4
If you're going to put a password in a function or macro that others  will  be using  encrypt the entire  macro  or function  then no code will show while it's  encrypted. . I think that is what your  after

select macro or function from list on left side of qm. then click tools/ options / then click security tab on options dialog.
input password here
   
then click
   
and yes you can remove those out statements

once encrypted all you see is 
Code:
Copy      Help
;<encrypted>
 for the code
#5
@kevin 

I need to generate the exe file, the above method, is it only applicable in the QM code?

If the password is in plain text, use the binary tool to search for the password field.
#6
No exe should remain encrypted if made with encrypted function or macro
you may need to put the macro/function in an a folder first to create the exe.


Forum Jump:


Users browsing this thread: 1 Guest(s)