0

I'm trying to figure out the best method for encrypting or encoding a URL in my code, this is what it looks like:

$ProUpdateChecker=new PluginUpdateChecker('http://the-url-is-here.com/file.json',__FILE__,'pluginslug');

I want users to not be able to see that URL. I'm not too worried about them being able to decrypt it, I just want a little bit of added security since mostly newbies will be using my script anyways.

What is the best method to accomplish this? I used ionCube to encode the entire code (not just the URL), but it broke some of the functionality.

4
  • Did you considered url_encode and rawurlencode? Commented Mar 22, 2011 at 15:13
  • 2
    This is basically Security through obscurity. Commented Mar 22, 2011 at 15:22
  • It's not security at all, it's purely obscurity. He said that. "I'm not too worried about them being able to decrypt it." Commented Mar 22, 2011 at 20:46
  • possible duplicate of Encrypt IDs in URL variables Commented Apr 22, 2015 at 6:17

2 Answers 2

2

You could just store the base64 encoded version of the URL in your scripts as a string, and everywhere you use it run it through base64 decode.

$url = base64_decode('VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==');

Sort of a silly, poor man's option, but you said keep it away from noobs...

Sign up to request clarification or add additional context in comments.

Comments

2

If you are just trying to make it so the URL isn't readable ASCII text, try Base64 Encoding: http://php.net/manual/en/function.base64-encode.php

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.