added c-compatible encrypt/decrypt methods