While I am very very sad that you need to pass an actual instance of CBC here, the IV should be bytes, not an int.