Ecnrypting Global Variables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
davidprogramer
Forum Commoner
Posts: 64
Joined: Mon Nov 28, 2005 6:11 pm

Ecnrypting Global Variables

Post by davidprogramer »

Ok. Yes. Obviously I am making a lot of threads about this. I am really worried about the security of em. So. I was wondering if its possible to encrypt them. I did read up about mcrypt or something similar to that (not sure if thats the right term). Can someone simply explain or even point me in the right direction to encrypting and decrypting globals? :wink:
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

why do you want to encrypt global variables? why not just NOT declare the variable global and be done with it? anyway:

mcrypt

some documentation on mcrype although I really don't think this makes any sence for your situation
davidprogramer
Forum Commoner
Posts: 64
Joined: Mon Nov 28, 2005 6:11 pm

Post by davidprogramer »

Well I need to figure out a way to pass global variables (between pages) and not have them changed AT ALL... Is there a way to transfer information between pages without using global variables? :oops:

edit:

Any time I try using mcrypt functions I get an error, that the function can't be found. Is there a specific include that I need?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Is there a way to transfer information between pages without using global variables? Embarassed
Why not use sessions or a database?
davidprogramer
Forum Commoner
Posts: 64
Joined: Mon Nov 28, 2005 6:11 pm

Post by davidprogramer »

Because they are only temp until the user gets to the intended page.

Also. I cant use sessions because the invite system sends a PM from one user to another, thus voiding out the use of a session id :cry:

Though...you bring up a good point. I suppose I could write..some sort of KEY if you will that looks something like this "32khj432187hfdas" and use that key as a way to get that one row...making it harder to just ....change a number here and there to remove every player in a clan lol.

I don't know -_-



edit:

Ooooh So close...Check this link out!
http://www.datalogik.org/e107_files/downloads/dencrypt

It encrypts/decrypts strings ... ONLY STRINGS. I need somethign that will encrypt and decrypt VARIABLES...So close I wana cry -_-


I have found how to use base64_encode and decode. It works nicely but each of the id's only have about 2 letters and then 2 == signs..

Here is a link to one of the clans:
javascript:popUpClan('modules.php?name=League&file=clan_hq&lid=1&cid=MQ==')

Here is another link:
javascript:popUpClan('modules.php?name=League&file=clan_hq&lid=1&cid=MTI=')

They are TOO similar. Anyway to take the == out and replace it with some more characters?
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

I think your system design structure is flawed.

There should always be an effective way to transfer variables between pages.

I recommend checking out some open source applications from HotScripts.com and other sites and look at how they handle this sort of thing.

That's the beauty of the open source revolution. You can discover and refine your existing programming methods by learning by the examples of others.
Post Reply