How to Code Encryption Algorithm in Java?

Make an unbreakable encryption for a hotmail code on my website?

  • I have a code thats really simple BUT I dont want anyone to ever see it or read it. EVER. So before you answer, read this: I do NOT want to add a no right click to my pages (useless) and (with all due respect to you) am NOT looking for opinions on why I want to do it, or reasons why NOT to do it. I know that I can encrypt it but then someone only has to view my source, copy the code and use a decryptor. (so, again, useless) It is the same with Java. For your imaginings, envision I have my html page at my website, but that my images are hosted elsewhere. If someone sees my source code, they just go there and download. I would like to encrypt my page so that no-one can ever read WHERE the image is. (This is not actually what I want to do, but now you understand what I want) Simple question: IS there a way to ENCRYPT hotmail code on a page so that NO-ONE can EVER read it? Is there a script where I give the script a PASSWORD and it MAKES a code based on that? So that you need to know the password to decrypt the data in it? Like the enigma code used in ww2. I think its called a cipher, without the cipher code you cant decrypt it. ANYONE? Please, no opinions, I really need an answer. I need to know ANY way to make my html code NOT readable.

  • Answer:

    No can do.... you can't get there from here as they say... ALL HTML is readable. All you can do is obscure it somewhat, but you can NOT hide it from someone determined. You already know this with disabling a right click and such... The problem is, the browser used has to interpret the page. If you encrypt anything ON the page, and the browser can't interpret what to DO with it, it simply is not displayed, but anyone can still see the page source if they simply look. There is no way to stop someone from looking at the source code for the page. The best you can do is use something like an archive program and password protect the archive. Then, you provide an alternate method of communicating the password to the people you want to have access. Or, you could alternatively password protect a directory on the server and put the page you want to protect there. When someone clicked on the link to the protected page, they would be challenged for a ID and password for access. No one can see the source code for the protected page until they get TO the page and that means having the ID and password for the directory where the page is located. The problem is with the rights structure on the server. Anyone and everyone has "read" rights in the "home" directory to display the default INDEX.HTML page (or whatever file is the default for the server). What they can't see is any page not referenced IN the home page itself. So, what you can do is use a separate page. No one will even know it is there, but if you explicitly name the file in the URL, it will display like any other page. Not encrypted, just out of sight and no way to see a directory listing. So, you can create a subdirectory with an obscure name such as "\xzy" and in this directory you place a password protected archive "a1x.zip". Then, a person would have to know the subdirectory and filename to get the file. (this is NOT a real URL, but just an example so you can see what it looks like) http://www.yourdomain.com/xzy/a1x.zip Since no one can see a directory of your domain home, no one will see the xzy subdirectory so no one will ever see the a1x.zip file either, and if you use a password on the zip archive, no one will ever see what is IN the file... except for the people who you TELL about the existence AND the password. ZIP and RAR archives use very strong encryption. The only way to get into an encrypted archive is to use brute force. Brute force is where you treat all of the printable ASCII characters like numbers and then you "count" and try each. The problem is TIME. In essence, you are counting in base 96. That means 96 place holders in the 1st column, which when you add 1 more, results in a carry, so there are 96 increments from 0 to 10. So, if the password is a single character, it takes at most 96 tries. If two characters, then 96 groups of 96 tries. Remember, brute force assumes the worst case that you have to try ALL of the numbers as you count your way through. For a 3 character password it could take 96 groups of 96 groups of 96. You can see that for each character I add, I simply multiply by 96. An 8 character password has 96^8 possibilities. My scientific calculator says 7.2139^10^15. Let's say you only have to count half way, to 3.6x10^15. And let's say you can test 10^6 tries per second. That still means 10^9 seconds, which equates to about 115 YEARS. So, if you generate a random number 10 digits long, using all 96 printable characters, no one is going to break the password even with the most powerful supercomputers. Sorry, didn't mean to preach... it is just that what you want to do is not possible, at least not possible to do it the way you want to. I only propose an alternative to encrypt the data and then restrict access to the file itself. Except for the password for the archive, this is known in the trade as security by obscurity...

Cat J at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

html is not short for hotmail. Clearly, you have no clue what you are doing. More than likely, someone has already written the same code you think you have, and offers it for free anyway.

Dick McCreamHammer

Yes.. this is answers. And you'll get better answers when you're not being an ignorant, obnoxious a@shole. You could accomplish this using something like ASP. You cannot do it with straight HTML.

How Would I Know

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.