SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php+mcrypt+Blowfish encrypt files

    Please help! May be you have some real working example of such combination:
    Encrupt file (in my case XML) with PHp mycript by using Blowfish algorythm.

    Is it possible actually? As I see in examples, there are just string encryptions, but no file.

  2. #2
    SitePoint Evangelist hexburner's Avatar
    Join Date
    Jan 2007
    Location
    Belgium
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can read the contents of a file in PHP, then encrypt the contents, and last but not least, save it to the file.
    FOR SALE: 1 set of morals, never used, will sell cheap

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you know other way witch works directly on files and also on Dot.Net?

  4. #4
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Open the file by getting the content then encrypt it then save it back to the file.

    PHP Code:
    <?php

    $data 
    file_get_contents('file.ext');

    # Encrption code...

    file_put_contents('file.ext'$encryptedData);
    unset(
    $data);
    Just as hexburner said.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •