Hi all,
I’m trying desperately to implement TEA.java (from the security plugin) and I’m pretty sure I’ve got everything right up until I invoke TEA.decrypt()…
Here is my implementation:
String streamName = httpCupertinoStreamingSession.getStreamName();
getLogger().info("streamName: "+streamName);
String decoded = new String(Base64.decode(streamName));
getLogger().info("decoded: "+decoded);
String unencryptedStreamName = TEA.decrypt(decoded, "MaryHadALittleLA");
getLogger().info("unencryptedStreamName: " + unencryptedStreamName);
MaryHadALittleLA is the TEA key
However, when I run this, I get:
2011-11-27 21:21:00 CET comment server INFO 200 - streamName: xvd91AbZi4eiLc/6oAZQhpgLkzougfcZRUWiqi1K1Dip9Zn+lrmNaeyfmqlDVIP7RiqBFd0GkTvQHsSD5vClfg== - - - 0.281
- - - - - - - - - - - - - - - - - - - - - - - - -
2011-11-27 21:21:00 CET comment server INFO 200 - decoded: Æ÷}ÔÙ‹‡¢-Ïú*P†˜
“:.÷EE¢ª-JÔ8©õ™þ–¹i쟚©CTƒûF*Ý‘;Ðăæð¥~ - - - 0.282 - - -
- - - - - - - - - - - - - - - - - - - - - -
2011-11-27 21:21:00 CET comment server ERROR 500 - invoke(onHTTPCupertinoStreamingSessionCreate): java.lang.NumberFormatException: For input string: "Æ÷": java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) - - - 0.283 - - - - - - - - - - - - - - - - - - - - -
This is coming from a html5 video embed of:
<video x-webkit-airplay="allow" id="example_video_1" class="video-js" width="640" height="264" controls="controls" preload="auto" poster="http://video-js.zencoder.com/oceans-clip.png">
<source src="http://<SERVER>:1935/<APP>/_definst_/xvd91AbZi4eiLc%2F6oAZQhpgLkzougfcZRUWiqi1K1Dip9Zn%2BlrmNaeyfmqlDVIP7RiqBFd0GkTvQHsSD5vClfg%3D%3D/playlist.m3u8"
</video>
the TEA encrypt has worked (it’s being passed in the URL as a base64 encoded string) since the values appear the same in the PHP tea decrypt output and the java decoded var. So, the problem is lying in
String unencryptedStreamName = TEA.decrypt(decoded, “MaryHadALittleLA”);
part…
ANY help greatly appreciated!!