Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20767

BASCOM-AVR : XTEA encryption problems : REPLY

$
0
0
Ok, I modified the formulas in JAVA to this: [code:1:e04d2ef49c] if (!decrypt) /* */ { /* 132 */ int sum = 0; /* */ /* 134 */ while (n-- > 0) /* */ { /* 136 */ v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + S[(sum & 0x3)]); /* 137 */ sum += -1640531527; /* 138 */ v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + S[(sum >> 11) & 0x3]); /* */ } /* */ /* */ } /* */ else /* */ { /* 144 */ int sum = -957401312; /* */ /* 146 */ while (n-- > 0) { /* 147 */ v1 -= (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + S[(sum >> 11) & 0x3]); /* 148 */ sum -= -1640531527; /* 149 */ v0 -= (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + S[(sum & 0x3)]); /* */ } /* */ } [/code:1:e04d2ef49c] Which gives me this result now: 3a1d92526c333d073a1d92526c333d07 - This result will decrypt fine using the decrypt statement in the java code, And this result is now different than previous runs. HOWEVER, it is still not the same as BASCOMs output.

Viewing all articles
Browse latest Browse all 20767

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>