Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Web-App-Sec
[Top] [All Lists]

Re: What problem have this Rijndael(.NET&PHP) code?

Subject: Re: What problem have this Rijndael(.NET&PHP) code?
Date: Sat, 16 Dec 2006 08:42:04 +1300
On 15/12/06, 김영일 <zero12a@naver.com> wrote:> Dear, web security Professionals.>> I have a AES problem.>> I want to 
send confidential data.>> STEP is bottom...>>>> * STEP> 1. Encrypt confidential-data by C#.NET.>> 2. Send encrypted data on 
HTTP(80) protocol.>> 2. Decrypt encyrpted data by PHP &amp; mcrypt(2.4.x)
I got PHP's mcrypt talking to the Botan library in C++ and I think oneof the 
issues was the padding scheme - not the actual mechanics of theencryption 
itself. Unfortunately, I don't have access to the sourcecode any more, and I 
don't  know the .NET implementation.
The Botan doc states : "In the case of the ECB and CBC modes, apadding method can also be specified. If it is not supplied, 
ECBdefaults to not padding, and CBC defaults to using PKCS #5/#7compatible padding. The padding methods currently available 
are"NoPadding", "PKCS7", "OneAndZeros", and "CTS". CTS padding iscurrently only available 
for CBC mode, but the others can also be usedin ECB mode."
I seem to remember that I had to use 'NoPadding' to interoperate withPHP - the PHP docs 
are kind of vague on this. Google suggests you mayneed "RijndaelCipher.Padding = 
PaddingMode.None;" in your .NET stuff.
(You know that ECB mode isn't a great one to use unless you don't haveany 
patterns in your plaintext? CBC is probably best for encryptingdata etc.)
Hope this helps a bit.
cheers, Jamie-- Jamie Riden, CISSP / jamesr@europe.com / 
jamie.riden@gmail.comNZ Honeynet project - http://www.nz-honeynet.org/

<Prev in Thread] Current Thread [Next in Thread>