Skip to content

Instantly share code, notes, and snippets.

View gbalduzzi's full-sized avatar
🏀

Giorgio Balduzzi gbalduzzi

🏀
View GitHub Profile
@gbalduzzi
gbalduzzi / app_attest_verification.php
Last active November 5, 2024 07:04
Apple App Attest verification
<?php
const PACKAGE_NAME = 'com.your.bundle_id';
const APPLE_TEAM_ID = 'ABCDEFGHIJK'; // 11 alphanumeric team ID
const ALLOW_DEV_ENVIRONMENT = true;
use CBOR\Decoder;
use CBOR\StringStream;
@gbalduzzi
gbalduzzi / rsaEncDecOpenSSL.c
Created May 26, 2016 09:51
AES Encrypt a file using a random generated 256-bit key and encrypt the AES key using RSA public key, then decrypt AES key using private RSA key and decrypt file.
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <openssl/evp.h>
#include <openssl/aes.h>
#include <openssl/bio.h>
#include <openssl/ssl.h>
#include <openssl/rsa.h>
void encrypt(EVP_PKEY **pub_key, FILE *ifp, FILE *ofp, unsigned char **key, int *ekl, unsigned char *ivec) {