Help
-
I'am a bigenner in cyptology. It's really an interested domain. I have started in cryptography by modifyiong the round function of xtea and by modifying the p-layer of PRESENT. I find it sample but when I will do differential and linear cryptanalysis on them it becomes more difficult because I didn't find a sample example to understand more the principle. Can anyone help me with code c of differential cryptanalysis of PRESENT and XTEA. I will be grateful for you
-
I'am a bigenner in cyptology. It's really an interested domain. I have started in cryptography by modifyiong the round function of xtea and by modifying the p-layer of PRESENT. I find it sample but when I will do differential and linear cryptanalysis on them it becomes more difficult because I didn't find a sample example to understand more the principle. Can anyone help me with code c of differential cryptanalysis of PRESENT and XTEA. I will be grateful for you
-
I have searched in different sites but I didn't find any code that can help me
-
I have searched in different sites but I didn't find any code that can help me
-
I have searched in different sites but I didn't find any code that can help me
You didn't look very hard the C code is right there in wikipedia (XTEA - Wikipedia[^])
#include
/* take 64 bits of data in v[0] and v[1] and 128 bits of key[0] - key[3] */
void encipher(unsigned int num_rounds, uint32_t v[2], uint32_t const key[4]) {
unsigned int i;
uint32_t v0=v[0], v1=v[1], sum=0, delta=0x9E3779B9;
for (i=0; i < num_rounds; i++) {
v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + key[sum & 3]);
sum += delta;
v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + key[(sum>>11) & 3]);
}
v[0]=v0; v[1]=v1;
}void decipher(unsigned int num_rounds, uint32_t v[2], uint32_t const key[4]) {
unsigned int i;
uint32_t v0=v[0], v1=v[1], delta=0x9E3779B9, sum=delta*num_rounds;
for (i=0; i < num_rounds; i++) {
v1 -= (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + key[(sum>>11) & 3]);
sum -= delta;
v0 -= (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + key[sum & 3]);
}
v[0]=v0; v[1]=v1;
}The C implementation for PRESENT you can get here in 8, 16 or 32 bit ... PRESENT Encryption
In vino veritas
-
You didn't look very hard the C code is right there in wikipedia (XTEA - Wikipedia[^])
#include
/* take 64 bits of data in v[0] and v[1] and 128 bits of key[0] - key[3] */
void encipher(unsigned int num_rounds, uint32_t v[2], uint32_t const key[4]) {
unsigned int i;
uint32_t v0=v[0], v1=v[1], sum=0, delta=0x9E3779B9;
for (i=0; i < num_rounds; i++) {
v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + key[sum & 3]);
sum += delta;
v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + key[(sum>>11) & 3]);
}
v[0]=v0; v[1]=v1;
}void decipher(unsigned int num_rounds, uint32_t v[2], uint32_t const key[4]) {
unsigned int i;
uint32_t v0=v[0], v1=v[1], delta=0x9E3779B9, sum=delta*num_rounds;
for (i=0; i < num_rounds; i++) {
v1 -= (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + key[(sum>>11) & 3]);
sum -= delta;
v0 -= (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + key[sum & 3]);
}
v[0]=v0; v[1]=v1;
}The C implementation for PRESENT you can get here in 8, 16 or 32 bit ... PRESENT Encryption
In vino veritas
Thanks alot for your help but I have already got it and I also modify xtea round function to become more secure but my problem now is to understand the principle of differential cryptanalysis that's why I need code c of of differential cryptanalysis in both of algorithms xtea and PRESENT
-
Thanks alot for your help but I have already got it and I also modify xtea round function to become more secure but my problem now is to understand the principle of differential cryptanalysis that's why I need code c of of differential cryptanalysis in both of algorithms xtea and PRESENT
Okay I am just a boring old programmer you got me intrigued how do you produce code for the differential it would be incredibly long given the statistical spread of the output. I know for example AES is immune to any sort of differential attack if you look at the algorithm you can see why. I can tell you from practical doing it, that it's easier to just brute force attack these things. That is why I suggest the code doesn't exist :-) If you want to find out how secure your modification is time the bruteforce attack on it.
In vino veritas
-
Okay I am just a boring old programmer you got me intrigued how do you produce code for the differential it would be incredibly long given the statistical spread of the output. I know for example AES is immune to any sort of differential attack if you look at the algorithm you can see why. I can tell you from practical doing it, that it's easier to just brute force attack these things. That is why I suggest the code doesn't exist :-) If you want to find out how secure your modification is time the bruteforce attack on it.
In vino veritas
That is why I suggest the code doesn't exist
-
That is why I suggest the code doesn't exist
Have you tried brute forcing that cipher it's interesting, I just tried a small block :-)
In vino veritas