Need advice/help in regards to encryption/description with PHP and SHELL
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Need advice/help in regards to encryption/description with PHP and SHELL
Hi guys,
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):
fullname:Enrique Iglesias
email:enrique.iglesias@gmail.com
expirydate:20121106
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.
I can only speculate on the lack of an answer but possibly asking about forcing licencing authentication on a forum where such a philosophy is anathema to most might be a reason.
I'd consider using something other than crypt as it has historically been cryptographically weak. Similarly MD5 is also a fairly weak hash, though with a salt is still usable for some purposes.
I can only speculate on the lack of an answer but possibly asking about forcing licencing authentication on a forum where such a philosophy is anathema to most might be a reason.
I'd consider using something other than crypt as it has historically been cryptographically weak. Similarly MD5 is also a fairly weak hash, though with a salt is still usable for some purposes.
Thanks for reply. I'm also trying the same way, MD5+Salt. Let's see if I could make something out of it..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.