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

Encrypt non-php file

Author Message
Mastermix



Joined: 24 Jan 2006
Posts: 41

PostPosted: Thu Jan 26, 2006 6:46 pm    Post subject: Encrypt non-php file Reply with quote

i have a question about this
its no big deal if not possible but i tried this on an xml file which is imported into a forum
the xml is dealt with using the forums xml class and the contents dealt with using the implode command
i have read in the docs for ioncube there is a function for dealing with encrypted non-php files using the read command but this is a file thats already on the server and is dealt with using implode which is then put into an array for inserting into the database
is there a way to use this encrypt non-php under these circumstances?
Back to top
View user's profile Send private message
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2788

PostPosted: Thu Jan 26, 2006 9:18 pm    Post subject: Reply with quote

Hi

I'm not 100% sure of your question, but as well as the Encoder encryption features, the Loader API can both read and write encrypted files on the server, allowing you to handle encrypting of files during encoding time and reading from your application, or encrypting and reading files at the server end.

It should be easy to modify existing code to use the API functions to add the encryption functionality.
_________________
Community Admin
Back to top
View user's profile Send private message
Mastermix



Joined: 24 Jan 2006
Posts: 41

PostPosted: Thu Jan 26, 2006 10:28 pm    Post subject: Reply with quote

i have tried it as it is and it errors so i presume i need to add some code somewhere for the loader to decrypt it correctly

it basically uses the PHP function "file" to implode the XML contents into an array so doesnt use the PHP function read_file so unable to use the ioncube API equivalent ioncube_read_file

is there a ioncube API function equivilant to file which reads an encrpyted file directly into an array or is it ioncube_read_file i need to use and just change my code to use it?
Back to top
View user's profile Send private message
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2788

PostPosted: Thu Jan 26, 2006 11:47 pm    Post subject: Reply with quote

Firstly, by design you must call the decryption function from a file that your Encoder has encrypted. The logic for that should hopefully be obvious Smile

The read function itself reads a file into a string. This does the same job as the get_file_contents() function, except that it can decrypt. For convenience it will also return the raw contents of an unencrypted file, making it easy to code routines to handle either type of file. If required, you can determine whether the file had been encrypted.

So, you'll get a string with the file contents, and you can then operate on that as you wish. PHP has a rich variety of string manipulation and convenience functions, and turning your string into arrays of lines, splitting by separators etc. is all possible.
_________________
Community Admin
Back to top
View user's profile Send private message
Mastermix



Joined: 24 Jan 2006
Posts: 41

PostPosted: Fri Jan 27, 2006 6:21 pm    Post subject: Reply with quote

yes i can see the logic behind it having to be called from an encrypted file
i did "test" it without the calling file being decrypted however which is where my problem was. duh!

thanks again for your help Very Happy
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