use non-deprecated crypto functions

Compatibility for R16