Need advice/help in regards to encryption/description with PHP and SHELL
I made some shell scripts, which I want to be only used when a valid license key is available. Its like a software needs a key to make it run for limited time.
I'm not a programmer by job, but can understand the code and make code to fulfill my own purposes.
I did some research online and managed to make a SHELL script to encrypt and decrypt license key using simple 'crypt' command. Now, the thing is I want to encrypt the key through PHP and decrypt it in a shell, where PHP won't be available. I'm not sure at this moment if PHP does the same encryption/decryption as 'crypt' command does. Does it? If so, can anybody please give me advise to make this encryption to maximum security? what method should I go for SHA/MD5 etc.
What exactly I want:
1. Shell script generate a string/key on the system where my scripts are installed.
2. User copy that string/key and put it in his account on my website which would be scripted in PHP.
3. PHP will generate a string/key which my shell script will read from user output and store it in an encrypted license key file. The license key will enable my scripts to execute for the limited period of time.
The values in License key I'm using at this moment are (example values):
I think I'll need to add 'systemkey' and 'serialkey' values in this license key file.
Want this key file to be encrypted for user, but my 'shc' encypted SHELL scripts to be able to read the values from that encrypted license key file.
Thanks in advance!