Skip to content

Instantly share code, notes, and snippets.

View AndyNovo's full-sized avatar

Andy Novocin AndyNovo

View GitHub Profile
from salsa20 import Salsa20_keystream
a_str = Salsa20_keystream(100, "A"*8, 'a'*32)
print a_str.encode('hex')
#include <stdio.h>
#include <gcrypt.h>
int main () {
gcry_error_t gcryError;
gcry_cipher_hd_t gcryCipherHd;
size_t index;
char * salsaKey = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; // 32 bytes
char * iniVector = "AAAAAAAA"; // 8 bytes
#include <stdio.h>
#include <gcrypt.h>
int main (int argc, const char **argv) {
printf("%s\n", gcry_check_version(NULL));
return 0;
}
R=IntegerModRing(2**32)
def breaker(rands):
inv_c = [0, -55, 0, 0, 165, 0, 0, -330, 0, 0, 462, 0, 0, -462, 0, 0, 330, 0, 0, -165, 0, 0, 55, 1, 0, -11, -12, 0, 1, 11, 0]
for i in range(2**13):
m2s = Integer(i).digits(base=2, padto=13)
seed = R(0)
index2s = 0
for i in range(31):
if inv_c[i] != 0:
seed += R((rands[i]*2 + m2s[index2s])*inv_c[i])
def pseudo_rand(seed, n):
results = [Integer(seed)]
for i in range(1, 31):
results.append((16807*results[-1]) % 2147483647)
results.append(results[0])
results.append(results[1])
results.append(results[2])
for i in range(34, 344):
results.append((results[-31]+results[-3]) % 2**32)
output = []
class VariableGenerator(object):
def __init__(self, prefix):
self.__prefix = prefix
@cached_method
def __getitem__(self, key):
return SR.var("%s%s"%(self.__prefix,key))
a=VariableGenerator('a')
answers={}
#include <iostream>
#include <cstdlib>
#include <cstring>
using namespace std;
int main(int argc, char* argv[]){
long* ptr = new long;
long value = 15;
char user[20];
/* University of Deleware Custom Theme Stylesheet
* -----------------------------------------------------------------------------
* Colors
* -----------------------------------------------------------------------------
* #00539F Blue
* #FFD200 Yellow
* #bed600 Green - MBA only
*/
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
void show_chunk_hex(void* start, size_t bytes){
int i=0;
for(;i<bytes;i+=1){
printf("%02x", *((unsigned char*) (start+i)));
}
printf("\n");
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
void show_chunk_hex(void* start, size_t bytes){
int i=0;
for(;i<bytes;i+=1){
printf("%02x", *((unsigned char*) (start+i)));
}
printf("\n");