You can't do this, Flex runs in the Flash "Virtual Machine" and to run Java you'd need a Java Virtual Machine, two totally different technologies.
Can you use HTTP over SSL instead (HTTPS)?
1 person found this helpful
Check out the Action Script 3 crypto library - http://code.google.com/p/as3crypto/.
It allows you to use most of the popular crypto alghoritms in Flex. So, the easiest way should be finding the one that's available in both Flex and Java.
I think that all business rules need to be made on server side. Then the user enter with your pass. You send it to server over SSL (HTTPS) and then check in your database if it is correct. I think that md5 for this case is safer that DES. You don't need known the original pass you just need compare it.
Then you just use flex to interface with user but all rules are made by server. You don't need nothing of crypt on cliente just in java like you already know.