Bunch of crypto related functions for Swift