0

I am looking for simple symmtric algorithm (low on processing power) in php.

An encrypted value will be stored as a session_id on client end. And will have logged in status saved in it.

Also I need to also decrypt it on server side. Please suggest....

2
  • check the accepted answer of stackoverflow.com/questions/5387755/… Commented Jun 9, 2011 at 10:54
  • thanks..this is what i want..I will check on processing power... Commented Jun 10, 2011 at 7:24

2 Answers 2

1

The only constraint you've mentioned is low processing impact - but you've provided no details of the strength of the algorithm required.

Also, if the encryption is implemented in PHP, then it will be several orders of magnitude less efficient than native code as provided by the mcrypt extension (and others).

An encrypted value will be stored as a session_id

Why????

The session id is randomly generated and therefore not predictable / guessable. And sessions provide a mechanism for storing data on the server. If the issue is to maintain secure data outside of the session due to shared hosting constraints, then this is not the right way to solve the problem.

There are native PHP implementations of various algorithms, TEA being an obvious choice, and str_rot13() is available even if mcrypt/openssl extensions are unavailable. But I can see no logical application of these methods to any problem.

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

2 Comments

when i said "session_id" i did not mean the session_id which is used to track user..I just meant login information when i said session_id..Sorry for misunderstanding
If you're just wanting a "remember me" function then use a randomly generated value for the cookie - effectively a long-lived session. If you want to track who is currently logged into your DB then switch to using a DB bound session handler.
0

I suggest you use the mcrypt-extension. there you go for some simple examples.

It offers you many symmetric encryptions.

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.