Timeline for data encryption in PHP using base64 with key
Current License: CC BY-SA 3.0
20 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 20, 2020 at 9:12 | history | edited | Community Bot |
Commonmark migration
|
|
| Oct 28, 2016 at 19:16 | vote | accept | K.Liaqat | ||
| Feb 24, 2016 at 21:09 | answer | added | Scott Arciszewski | timeline score: 4 | |
| Sep 25, 2014 at 15:13 | comment | added | Mark Baker | @owlstead - There's homebrew and there's homebrew, I'd certainly trust PHP's mcrypt (as a wrapper around libmcrypt) more than I'd trust a Vignere-style cipher written as the above | |
| Sep 25, 2014 at 15:07 | comment | added | Maarten Bodewes | @MarkBaker PHP's build in encryption functions are bad homebrew. But I understand what you're trying to say :) | |
| Sep 25, 2014 at 15:06 | comment | added | Maarten Bodewes | Please update the code and your requirements in your question. Normally the question should not change significantly, but currently it cannot be answered anyway, so.... | |
| Sep 25, 2014 at 15:04 | history | edited | Maarten Bodewes |
edited tags; edited tags
|
|
| Sep 25, 2014 at 10:56 | comment | added | Hardy Mathew | @khurrum , even your code is not working properly , have you please let us know your exact requirement so we can help you in more efficient manner. | |
| Sep 25, 2014 at 10:37 | comment | added | K.Liaqat | my code looks too weird now... but please help | |
| Sep 25, 2014 at 10:36 | comment | added | K.Liaqat | @MarkBaker, now I am shifted to md5 (thanks for your suggestion). Here is my code $key="check"; $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $variableValue, MCRYPT_MODE_CBC, md5(md5($key)))); decryption code is as follow $key="check"; $variableValue ="skype" $decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($variableValue), MCRYPT_MODE_CBC, md5(md5($key))), "0円"); echo $decrypted ; Now input skype (encryption value =%05¢%20_¤) output after decryption (X¡xEîl0^~=‹&@y—ß^¥„Òê£}΋;JåHà $%$%$) | |
| Sep 25, 2014 at 10:14 | comment | added | Mark Baker | Well you could always use PHP's built-in encryption functions rathe rthan a bad homebrew.... but this works correctly as long as your input id to decrypt is correct | |
| S Sep 25, 2014 at 10:13 | history | edited | John Kiernander | CC BY-SA 3.0 |
improved formatting
|
| S Sep 25, 2014 at 10:13 | history | suggested | Gowri | CC BY-SA 3.0 |
improved formatting
|
| Sep 25, 2014 at 10:08 | comment | added | Mark Baker |
mk5?!? Do you mean md5? No, md5 is a hashing algorithm. It's one-way (you can't get the cow back from the beefburger), and flawed
|
|
| Sep 25, 2014 at 10:07 | comment | added | K.Liaqat | I am new in PHP.. can you please elaborate this?? @MarkBaker if I am not wrong you mean that I should use mk5. | |
| Sep 25, 2014 at 10:07 | review | Suggested edits | |||
| S Sep 25, 2014 at 10:13 | |||||
| Sep 25, 2014 at 10:05 | comment | added | Mark Baker |
No you're not using base64 for encryption; you're using base64 for encoding.... you're using a weird for($i=0; $i<strlen($string); $i++) { $char = substr($string, $i, 1); $keychar = substr($key, ($i % strlen($key))-1, 1); $char = chr(ord($char)+ord($keychar)); $result.=$char; } for "encrypting"
|
|
| S Sep 25, 2014 at 10:04 | history | suggested | Naincy | CC BY-SA 3.0 |
Formatted code
|
| Sep 25, 2014 at 10:01 | review | Suggested edits | |||
| S Sep 25, 2014 at 10:04 | |||||
| Sep 25, 2014 at 9:59 | history | asked | K.Liaqat | CC BY-SA 3.0 |