crossbridge-community / crossbridge

C/C++ Compiler for the ActionScript Virtual Machine (AVM2)
http://sourceforge.net/projects/crossbridge-community/
Other
151 stars 35 forks source link

Where to ask questions how to use the crossbridge SWCs? #86

Closed etulfnap closed 9 years ago

etulfnap commented 9 years ago

I can not find any right places to ask about crossbridge modules. It seems, mcrypt is very useful for my current project, however, I can not make it work. Unfortunately, I'm not familiar with C, and compiling procedures. I need to decrypt multiple of jpgs that are encrypted in AES256, Is current crossbridge-mcrypt.swc capable of decrypt these files? It would be really nice and appreciated give a simple sample codes.

ps. If this is not right place to ask question, please kindly advise.

JoeDupuis commented 9 years ago

I am pretty sure it support AES256 from what I see in the documentation. For a sample you can check this repository: https://github.com/crossbridge-community/crossbridge-swc-mcrypt/blob/master/src/main/actionscript/Main.as

I would check MCrypt documentation for more info on how to use it.

If you have trouble with compilation or usage related to crossbridge (I don't know mcrypt at all so I might not be able to help with the API specifics) you can ask in the crossbridge forum: http://forum.crossbridge.io

etulfnap commented 9 years ago

I solved the problem. Many thanks, It was AES128. It is simple and fast !!. :) For someone who is novice like me, here's my code.

var ecryped:ByteArray = // put encrypted bytearray var decrypted_ba:ByteArray = new ByteArray(); var bytesPtr:int = CModule.malloc(ecryped.length);
CModule.writeBytes(bytesPtr, ecryped.length, ecryped); ClientLib.ext_decrypt(ClientLib.MCRYPT_RIJNDAEL_128, ClientLib.MCRYPT_CBC, bytesPtr, ecryped.length, "1234567890123456", "aeskey12312312312312312312312312", 32); CModule.readBytes (bytesPtr, ecryped.length, decrypted_ba);