Asim Zaidi
Asim Zaidi

Reputation: 28284

encrypt / decrypt file

I have a need to encrypt and decrypt files using php. I need to have other users a preshared key to be able to decrypt the file. The encryption should be at the lease AES 128. Are there any good articles or tutorials on that thanks

Upvotes: 2

Views: 672

Answers (3)

Slartibartfast
Slartibartfast

Reputation: 1700

It is not at all clear what your goal is. Essential parts of the problem are:

  • Key sharing. How do you securely get the key to the user?
  • Encryption. How do you ensure the security of the key when encrypting the data?
  • Problem. You need to clearly state what problem that you expect encryption to solve.

Hopefully this will help you form new questions.

Upvotes: 0

AndreKR
AndreKR

Reputation: 33658

Depending on the application I sometimes use http://phpseclib.sourceforge.net/ because it is pure PHP (runs on every PHP server without needing any extensions).

Upvotes: 3

winwaed
winwaed

Reputation: 7801

There are multiple libraries, but the most common is probably mcrypt. A quick Google brings up a host of mcrypt tutorials, eg

http://www.itnewb.com/v/PHP-Encryption-Decryption-Using-the-MCrypt-Library-libmcrypt

Upvotes: 4

Related Questions