ionCube Logo
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


 
Post new topic   Reply to topic    ionCube Forum Index -> ionCube PHP Encoder

Load Only Encrypted Image

Author Message
kashyap



Joined: 25 May 2016
Posts: 2

PostPosted: Wed May 25, 2016 8:21 am    Post subject: Load Only Encrypted Image Reply with quote

Hello All,

I have encrypted one PNG file and used ioncube_read_file function to get it display.

But if I put un encrypted PNG file then also it is getting displayed.

What I want is if image is encrypted then only display the image. Otherwise it should display blank.

What I have done is

$logo_path ="/path_to_decrypt_file/decrypt.php?i=img/image.png";

and used $logo_path as src in img tag.

In decrypt.php

<?php
echo ioncube_read_file("/var/www/html/my_project/"."".$_GET['i']);
?>

Image is located at /var/www/html/my_project/img/image.png

Anyone knows how to achive this?.

Thanks in advance.
Back to top
View user's profile Send private message
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2771

PostPosted: Thu May 26, 2016 5:38 pm    Post subject: Reply with quote

There's a second optional parameter to ioncube_read_file that can tell you whether the file was encrypted. Read the file into a string, check the parameter, and then decide whether to echo the contents.

Are you sure that encrypting the images will be useful? They can be grabbed in several ways at the client end. In the simplest case, someone could just take a screenshot and crop it.
_________________
Community Admin
Back to top
View user's profile Send private message
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2771

PostPosted: Thu May 26, 2016 5:41 pm    Post subject: Reply with quote

I'm curious about why you are encrypting the images, but did think that it could be a good way to prevent removal of branding. You might have an image that you want displayed, and you want to prevent changing of the image. Am I close? Smile
_________________
Community Admin
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ionCube Forum Index -> ionCube PHP Encoder All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum