Action script as3 CB mode cipher length must be a multiple of blocksize 16 error while converting string cyber text to byte array

After Aes Encryption while converting into string i added the following code and finally, all the things went correct......... aes.encrypt(cleartextBytes); trace("after Encription-------------"+cleartextBytes.length+cleartextBytes); cleartextBytes.position=0; var myEncoder:Base64Encoder = new Base64Encoder();

Action script as3 CB mode cipher length must be a multiple of blocksize 16 error while converting string cyber text to byte array

After Aes Encryption while converting into string i added the following code and finally, all the things went correct.........

            aes.encrypt(cleartextBytes);
            trace("after Encription-------------"+cleartextBytes.length+cleartextBytes);
            cleartextBytes.position=0;
            var myEncoder:Base64Encoder = new Base64Encoder();

            myEncoder.encodeBytes(cleartextBytes);

            cyperText.text=myEncoder.toString();

            trace("Encoded string length"+cyperText.text.length);