I
I
Igor2016-02-23 20:13:06
Images
Igor, 2016-02-23 20:13:06

How to safely store important images?

Good evening) I am developing a small CRM for working with clients in php and mysql. The downloader wished to attach a scan of the passport to the client's card. How to properly store these documents, so that in which case they do not get to third parties. Maybe some kind of encryption, or not bother about it at all?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor, 2016-02-25
@Igor_307

He asked himself - he answered. I will not add the function itself, I will only describe the algorithm
1. Get the contents of the file file_get_contents ()
2. Encode in base_64
3. Part of the string obtained after base_64 XOR cipher
4. Save to a new file.
To get a photo back from an encrypted file, follow the same steps in reverse order.
I don’t know how safe it is, but I didn’t come up with anything better and faster

A
Alexander Kovalenko, 2016-02-29
@kowalski

It would be better for the customer to familiarize himself with No. 152-ФЗ “On Personal Data”, think about it and wish it back.
XOR is only good when the length of the key is equal to the length of the file, but that won't save you either)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question