Hey,
Is there any type of encryption that is both in javascript and in php?
What i want to do is be able to encrypt something with a php script and decrypt it in javascript so that it is not readable to the human eye.
Thanks in advance
Hey,
Is there any type of encryption that is both in javascript and in php?
What i want to do is be able to encrypt something with a php script and decrypt it in javascript so that it is not readable to the human eye.
Thanks in advance
Are you talking about something like this: http://scriptasylum.com/tutorials/en...de-decode.html
??![]()
No, s/he isn't. I think s/he is talking about actual encryption.
kkroo: Unfortunately, this is not possible. The reason for this is that your Javascript is visible to anyone, and you must include the decryption algorithm and any necessary keys in that Javascript. Ergo, it is impossible to do this securely.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
OOPS!! Sorry for the misunderstanding.![]()
Yea that seems to be a disadvantage of making rich internet APIs in a client side scripting language.![]()
The method shachi has is alright, you cant read the source code with it. But what php function would be able to do that?
the PHP(simple one)
echo '<script type="text/javascript">document.write(unescape(encoded code));</script>
I mean doing it without javascript, like an actual php function
Umm.. sorry to disappoint you but I don't think that it is possible or may be my knowledge is not enough as I am not that good at PHP. Try asking the guyz on IRC freenode. I bet they would help you out of this problem. But that's just an advice.
Good luck!!!![]()
or may be Twey knows something about it?? Try messaging him or wait till he looks at this message again.
Code:<?php function urlfuscate($str) { $op = ""; for($i=0;$i<strlen($str);$i++) $op .= "%" . bin2hex(substr($str, $i, 1)); return $op; } ?>
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks