added decrypt function to rscommon