?
Solved

encrypt an image

Posted on 2006-05-09
5
Medium Priority
?
295 Views
Last Modified: 2006-11-18
Hello is it possible to encrypt an image and storing it as longblob?

0
Comment
Question by:pruymboom
  • 2
3 Comments
 
LVL 49

Expert Comment

by:Roonaan
ID: 16637908
Yes,

You can do $imgSrc = file_get_contents('path/to/image');

$encryptedImageSrc = someEncryptionFunc($imgStc);

And then put it in your db.

-r-
0
 

Author Comment

by:pruymboom
ID: 16648744
Thanks but is it also possible with an upload image?

like:

$file = fopen($_FILES['image']['tmp_name'], "r")
$image = addslashes(fread($file, $file_size));

$encryptedImageSrc = someEncryptionFunc($image);
0
 
LVL 49

Accepted Solution

by:
Roonaan earned 80 total points
ID: 16648799
$image = file_get_contents($_FILES['image']['tmp_name']);

-r-
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question