updated the cipher and key generator for clearer interface. now the bouncy castle api is directly used.