external decrypter function