Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^3: Add PKCS#7 padding

by Anonymous Monk
on Dec 18, 2013 at 00:29 UTC ( #1067557=note: print w/replies, xml ) Need Help??

in reply to Re^2: Add PKCS#7 padding
in thread Add PKCS#7 padding

So... any idea why the .net version is twice as long? Are you sure your perl script decodes them both to the same thing? Have you tried printing the result with MIME::QuotedPrint to see if there are any weird nonprinting characters in there?

Replies are listed 'Best First'.
Re^4: Add PKCS#7 padding
by burgerc (Novice) on Dec 18, 2013 at 15:56 UTC
    I have fixed the problem. .net (microsoft) considers unicode to be utf16 not utf8. Once I converted my string to utf16 the encryption worked fine.

    Crazy microsoft.

    thanks for all your help in this. I have updated my initial code to show the utf16 encoding so this may help others in the future. I did notice that UTF16 did not work but UTF16le did. Not sure what the difference is.

Re^4: Add PKCS#7 padding
by burgerc (Novice) on Dec 18, 2013 at 14:12 UTC
    I do not know why it is twice as long. They do decrypt to the same string. I will print with MIME::QuotedPrint to see what I get with that. Thanks

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1067557]
[Discipulus]: ;=P

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2017-11-23 12:52 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (335 votes). Check out past polls.