//declare nonce unsigned char myNonce[16] = "UQOW$#+v"; //counter for CTR mode long long * counter = (long long *)&myNonce[8]; (*counter) = 0; //for loop to encrypt/decrypt for () { //increment the counter (*counter)++; }