Advertisement
Guest User

Crypto Confusion Rounds

a guest
Apr 11th, 2015
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. private void doBlockRound(byte[] key, byte[] keyParams, byte[] data, byte[] output) {
  2. short execute = Util.Random(1,2);
  3. if (execute == 1) {
  4. confuse();
  5. // Do actual crypto
  6. } else if (execute ==2) {
  7. // Do actual crypto
  8. confuse();
  9. }
  10. }
  11. private void confuse() {
  12. short state = Util.Random(1,3);
  13. if (state == 1) {
  14. byte[] dummy = toBytes(Util.Random(0, key.length)); //Random write
  15. } else if (state == 2) {
  16. // Some random compute like XORs and ANDs and Shifts
  17. } else if (state ==3) {
  18. byte[] dummy = toBytes(Util.Random(0, key.length)); //Random write
  19. // Some random compute like XORs and ANDs and Shifts
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement