encrypt an image

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

Question by:pruymboom
    LVL 49

    Expert Comment


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

    $encryptedImageSrc = someEncryptionFunc($imgStc);

    And then put it in your db.


    Author Comment

    Thanks but is it also possible with an upload image?


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

    $encryptedImageSrc = someEncryptionFunc($image);
    LVL 49

    Accepted Solution

    $image = file_get_contents($_FILES['image']['tmp_name']);


    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    This is a general how to create your own custom plugin system for your PHP application that you designed (or wish to extend a third party program to have plugin functionality that doesn't have it yet).  This is not how to make plugins for existing s…
    Both Easy and Powerful How easy is PHP? (  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now