TapeGun007 Posted June 7, 2013 Share Posted June 7, 2013 (edited) I want to create a decoding tool. To do this, I want to create a database with every character in the db, and each character would have up to 255 possibilities for each character. The problem that I'm having is I want to automatically write each character into the database including special characters like single quotes, double quotes, and open parenthesis. I thought about trying something like this: $characters = Array( A,B,C,......); foreach ($characters as $c){ < pull the characters > < generate random code > < write to db > } But of course, certain characters like ")" cause a problem in an array. I thought maybe I could do it by character string or something like that, but I can't seem to find any code examples of that. Any suggestions? Thanks. Edited June 7, 2013 by TapeGun007 Quote Link to comment Share on other sites More sharing options...
DaveyK Posted June 7, 2013 Share Posted June 7, 2013 Use an encryption class in PHP. You are trying to reinvent the wheel and make it square instead of round (not nearly as good). I respect that you are trying to write this on your own, but encryption algorythms are really complex. Besides, you want to create a database from every character in the database? For one, there will only be encrypted characters in your database, so you dont want to target the characters in the database but those you are receiving from the front end. In the end, you can always run a replace from every know character (which are quite a few) and it would be a breeze to break if anyone really wanted to. Quote Link to comment Share on other sites More sharing options...
cpd Posted June 7, 2013 Share Posted June 7, 2013 Whats your purpose? Are you trying to encrypt data? And brackets wont affect array's since you're representing it as a string. It would be silly if it did affect it as you couldn't do anything, e.g. array("(Hello world)"). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.