Why can’t I save encrypted data in a transient?

So the answer was to use base64_encode and base64_decode.

So basically doing something like this to set the transient:

$json_contact_info = json_encode( $contact_info );
$transient_data =  encrypt_text( $json_contact_info );
$transient_array = base64_encode( $transient_data );
$transient_set = set_transient( $transient_name, $transient_array, 60 * 60 * 24 * 7 );

And then to get the transient:

$decrypted_transient_data = decrypt_text( base64_decode( $transient_data ) );
$cr_json = json_decode( $decrypted_transient_data );