Encrypted links

Discussion in 'PHP' started by hasen, Aug 10, 2007.

  1. #1
    I want to know how to encrypt links in PHP. I want the links to show up as normal to anyone viewing the site and be normal links as far as google or other search engines are concerned, but I want the links encrypted if anyone were to look at the actual PHP code file.

    Thanks in advance. :)
     
    hasen, Aug 10, 2007 IP
  2. Fewleftstanding

    Fewleftstanding Peon

    Messages:
    438
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Good question..I do not know how to do this, but I am interested in how this would be done too.

    Can I assume this is for a Wordpress theme that you will be releasing?
     
    Fewleftstanding, Aug 10, 2007 IP
  3. l0gic

    l0gic Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I'm confused. You want the URLs in the PHP source to be stored in an encrypted format, and only decrypted when outputted to the user? Why? Anyone with access to the PHP source will likely have the encryption key as well. Or did I totally miss the objective?
     
    l0gic, Aug 12, 2007 IP
  4. hasen

    hasen Peon

    Messages:
    994
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If I release a template and I want some links to be impossible to alter by the user of the template. The only way would be to delete the encrypted code altogether.
     
    hasen, Aug 12, 2007 IP
  5. coderlinks

    coderlinks Peon

    Messages:
    282
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Maybe possible using some javascript. I suck at crypto tho. I can whip you up a BASE64 encoder if ya want :D . But then someone determined enough can crack it. Since if you use a keyed encryption, you got to have the key somewhere ..

    ~
    Thomas
     
    coderlinks, Aug 12, 2007 IP
  6. l0gic

    l0gic Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Base 64 isn't encryption, it's encoding, and thus designed to be easily reversed. It's used for representing binary data in an ASCII string.
     
    l0gic, Aug 13, 2007 IP
  7. hasen

    hasen Peon

    Messages:
    994
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Alright thanks guys. Does no one know how to do this then? I was expecting it wouldn't be too hard.
     
    hasen, Aug 13, 2007 IP
  8. RogerDodgr

    RogerDodgr Well-Known Member

    Messages:
    267
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #8
    Here's a easy way to encrypt an email link, it's not in php though. I've used it and it works. Maybe it can be easily modified for regular links: http://www.dynamicdrive.com/emailriddler/

    If you need it to be in php, I just found out that "php designer 2005" (was freeware) has a feature "convert to php" that turn the script into php real easily.
     
    RogerDodgr, Aug 13, 2007 IP