[PHP] PKCS#5 padding

2005-12-09 Thread Binay\(Local\)
Hi All Has anybody got the working code to apply the PKCS#5 padding to the text for encryption. Please let me know as it seems PHP inbuilt functions do not support this padding at all. Been worried about from past 2 days. Help me out. Thanks Binay

[PHP] PKCS#5 padding

2005-12-09 Thread Binay\(Local\)
Hi All Has anybody got the working code to apply the PKCS#5 padding to the text for encryption. Please let me know as it seems PHP inbuilt functions do not support this padding at all. Been worried about from past 2 days. Help me out. Thanks Binay

Re: [PHP] PKCS#5 padding

2005-12-09 Thread Robin Vickery
On 12/9/05, Binay(Local) [EMAIL PROTECTED] wrote: Hi All Has anybody got the working code to apply the PKCS#5 padding to the text for encryption. Please let me know as it seems PHP inbuilt functions do not support this padding at all. Been worried about from past 2 days. Help me out. The

Re: [PHP] PKCS#5 padding

2005-12-09 Thread Robin Vickery
U I made a mistake in the second test for validity in the unpad function. It should be this: function pkcs5_unpad ($text) { $pad = ord($text{strlen($text)-1}); if ($pad strlen($text)) return false; if (strspn($text, chr($pad), strlen($text) - $pad) != $pad) return false; return