How to change deault browser to Midori in Windows?
I'm new to Midori and can't locate option in 'preferences' (& anywhere else) where I can switch it to my default browser.
See also questions close to this topic

Use Java program to trigger a Windows Task Scheduler task
I'm making a home automation system in Java, and I'd like to have a program running on my computer that can take inputs from connected modules around the house and trigger tasks on my PC using Task Scheduler (like opening different apps or executing separate java programs). Is there a way to make a Java program trigger these tasks, or should I look for another tool to do this?

How to Set Permission on print queue for delete jobs only
I need to give permission to a certain group to be able to delete print jobs in network print queues only and nothing else, please assist!

How can I programmatically remove recent files from Quick Access in Windows 10?
From time to time I'll open a file for which I don't want to retain an entry in the Recent Files section of Quick Access.
How can I automate the removal of these entries?

Is there a way to fetch the most recent version number of the major browsers?
I would like to programatically have access to the latest version numbers of the major browsers. I looked at a few scripts like outdatedbrowser.js but it seems to do a live check for modern functions instead of strict version numbers (aside from IE) (not to mention I'd like to do this serverside).
Ideally I'd like a JSON list like:
{ "Browsers": { "Chrome": "68.0.3440.106", "Firefox": "61.0.2", "Safari": "11.1.2" } }
Of course, that's ideal  but if there's even a way to ping Google for the most recent version of Chrome, that would be sufficient.

emberJS resetting form fields when the user clicks on a browser's forward and back buttons
I am working on an emberJS application and I have a question regarding a browsers forward and back buttons: If a user navigates to a form, then fills out some information, then hits the browser back button, then the forward button, what is the proper way to reset the form so that the fields are blank again?
Do I need to explicitly set the fields to empty string or is there some way I can force a refresh rather than having the browser go to the cache?
Thanks,
Terry

Browser Security
I received a security issue recently.It seems to be "Man in the middle attack".
Suppose browser send a request to UI server and receive the response. But before response is received by browser, it is intercepted by some proxy (like fiddler or burpproxy), the hacker who hold the response, he first change it and then send to the browser.
The actual user doesn't know that the response has been changed. The application is running on https (SSL), then also it is getting changed.
I tried below things.
1 I analyzed HPKP (http public key pinning). It is aimed to fix these types of issues but it is not supported by all the browser (IE Safari).
It is supported by Chrome but i read an article that even chrome is planning to stop its support for HPKP.
2 I thought to send the encrypted data and decrypt at browser using javascript. But javascript logic is not possible to hide from hacker. I heard several article where it is said that javascript logic can be tried to hide, but we can not be sure that it can't be found by hacker.
Please provide some guidance where i should look for the solution to prevent this type of attack.
Regards, Saurabh

Midori128 Incorrect Ciphertext
I have a project in which I must implement a variety of Security Protocols for my Arduino Uno R3, such as Present, Misty, Prince, and so on. At the moment I am attempting to implement Midori128. I managed to get Midiori64 to work properly, but for Midori128 the encryption is incorrect, while the decryption works properly.
This is the code at the moment, bear in mind I pulled this code from GitHub, and then change it around to get it to work on Arduino as efficiently as possible; but like I said, the encryption is incorrect, and I don't know why.
#include <stdio.h> #include <stdint.h> static uint16_t s_box[16] = { 0x1,0x0,0x5,0x3,0xe,0x2,0xf,0x7,0xd,0xa,0x9,0xb,0xc,0x8,0x4,0x6 }; static uint16_t const_key[19][16] = { { 0,0,0,1,0,1,0,1,1,0,1,1,0,0,1,1 },{ 0,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0 }, { 1,0,1,0,0,1,0,0,0,0,1,1,0,1,0,1 },{ 0,1,1,0,0,0,1,0,0,0,0,1,0,0,1,1 }, { 0,0,0,1,0,0,0,0,0,1,0,0,1,1,1,1 },{ 1,1,0,1,0,0,0,1,0,1,1,1,0,0,0,0 }, { 0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,0 },{ 0,0,0,0,1,0,1,1,1,1,0,0,1,1,0,0 }, { 1,0,0,1,0,1,0,0,1,0,0,0,0,0,0,1 },{ 0,1,0,0,0,0,0,0,1,0,1,1,1,0,0,0 }, { 0,1,1,1,0,0,0,1,1,0,0,1,0,1,1,1 },{ 0,0,1,0,0,0,1,0,1,0,0,0,1,1,1,0 }, { 0,1,0,1,0,0,0,1,0,0,1,1,0,0,0,0 },{ 1,1,1,1,1,0,0,0,1,1,0,0,1,0,1,0 }, { 1,1,0,1,1,1,1,1,1,0,0,1,0,0,0,0 },{ 0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1 }, { 0,0,0,1,1,1,0,0,0,0,1,0,0,1,0,0 },{ 0,0,1,0,0,0,1,1,1,0,1,1,0,1,0,0 }, {0,1,1,0,0,0,1,0,1,0,0,0,1,0,1,0} }; uint16_t bit_permutation_0(uint16_t x) { uint16_t temp = 0x00; temp ^= ((x & 0x08) << 4), temp ^= ((x & 0x40)), temp ^= ((x & 0x02) << 4), temp ^= (x & 0x10), temp ^= ((x & 0x80) >> 4), temp ^= ((x & 0x04)), temp ^= ((x & 0x20) >> 4), temp ^= (x & 0x01); return temp; } uint16_t bit_permutation_1(uint16_t x) { uint16_t temp = 0x00; temp ^= ((x & 0x40) << 1), temp ^= ((x & 0x02) << 5), temp ^= ((x & 0x01) << 5), temp ^= ((x & 0x80) >> 3), temp ^= ((x & 0x04) << 1), temp ^= ((x & 0x20) >> 3), temp ^= ((x & 0x10) >> 3), temp ^= ((x & 0x08) >> 3); return temp; } uint16_t inv_bit_permutation_1(uint16_t x) { uint16_t temp = 0x00; temp ^= ((x & 0x10) << 3), temp ^= ((x & 0x80) >> 1), temp ^= ((x & 0x04) << 3), temp ^= ((x & 0x02) << 3), temp ^= ((x & 0x01) << 3), temp ^= ((x & 0x08) >> 1), temp ^= ((x & 0x40) >> 5), temp ^= ((x & 0x20) >> 5); return temp; } uint16_t bit_permutation_2(uint16_t x) { uint16_t temp = 0x00; temp ^= ((x & 0x20) << 2), temp ^= ((x & 0x10) << 2), temp ^= ((x & 0x08) << 2), temp ^= ((x & 0x40) >> 2), temp ^= ((x & 0x02) << 2), temp ^= ((x & 0x01) << 2), temp ^= ((x & 0x80) >> 6), temp ^= ((x & 0x04) >> 2); return temp; } uint16_t inv_bit_permutation_2(uint16_t x) { uint16_t temp = 0x00; temp ^= ((x & 0x02) << 6), temp ^= ((x & 0x10) << 2), temp ^= ((x & 0x80) >> 2), temp ^= ((x & 0x40) >> 2), temp ^= ((x & 0x20) >> 2), temp ^= ((x & 0x01) << 2), temp ^= ((x & 0x08) >> 2), temp ^= ((x & 0x04) >> 2); return temp; } uint16_t bit_permutation_3(uint16_t x) { uint16_t temp = 0x00; temp ^= ((x & 0x01) << 7), temp ^= ((x & 0x08) << 3), temp ^= ((x & 0x40) >> 1), temp ^= ((x & 0x20) >> 1), temp ^= ((x & 0x10) >> 1), temp ^= ((x & 0x80) >> 5), temp ^= ((x & 0x04) >> 1), temp ^= ((x & 0x02) >> 1); return temp; } uint16_t inv_bit_permutation_3(uint16_t x) { uint16_t temp = 0x00; temp ^= ((x & 0x04) << 5), temp ^= ((x & 0x20) << 1), temp ^= ((x & 0x10) << 1), temp ^= ((x & 0x08) << 1), temp ^= ((x & 0x40) >> 3), temp ^= ((x & 0x02) << 1), temp ^= ((x & 0x01) << 1), temp ^= ((x & 0x80) >> 7); return temp; } uint16_t Midori128_S_Box(int r, uint16_t x) { uint16_t y; if (r % 4 == 0) { y = bit_permutation_0(x); y = (s_box[(y & 0xf0) >> 4] << 4) ^ (s_box[(y & 0x0f)]); y = bit_permutation_0(y); } if (r % 4 == 1) { y = bit_permutation_1(x); y = (s_box[(y & 0xf0) >> 4] << 4) ^ s_box[(y & 0x0f)]; y = inv_bit_permutation_1(y); } if (r % 4 == 2) { y = bit_permutation_2(x); y = (s_box[(y & 0xf0) >> 4] << 4) ^ s_box[(y & 0x0f)]; y = inv_bit_permutation_2(y); } else { y = bit_permutation_3(x); y = (s_box[(y & 0xf0) >> 4] << 4) ^ s_box[(y & 0x0f)]; y = inv_bit_permutation_3(y); } return y; } void SubCell(int r,uint16_t *state) { int i; for (i = 0; i <= 15; i++) { state[i] = Midori128_S_Box(r%4,state[i]); } } void ShuffleCell(uint16_t *state) { int i; uint16_t temp[16]; temp[0] = state[0], temp[1] = state[10], temp[2] = state[5], temp[3] = state[15], temp[4] = state[14], temp[5] = state[4], temp[6] = state[11], temp[7] = state[1], temp[8] = state[9], temp[9] = state[3], temp[10] = state[12], temp[11] = state[6], temp[12] = state[7], temp[13] = state[13], temp[14] = state[2], temp[15] = state[8]; for (i = 0; i <= 15; i++) { state[i] = temp[i]; } } void Inv_ShuffleCell(uint16_t *state) { int i; uint16_t temp[16]; temp[0] = state[0], temp[1] = state[7], temp[2] = state[14], temp[3] = state[9], temp[4] = state[5], temp[5] = state[2], temp[6] = state[11], temp[7] = state[12], temp[8] = state[15], temp[9] = state[8], temp[10] = state[1], temp[11] = state[6], temp[12] = state[10], temp[13] = state[13], temp[14] = state[4], temp[15] = state[3]; for (i = 0; i <= 15; i++) { state[i] = temp[i]; } } void MixColumn(uint16_t *state) { int i; uint16_t temp[16]; for (i = 0; i <= 3; i++) { temp[4 * i + 0] = state[4 * i + 1] ^ state[4 * i + 2] ^ state[4 * i + 3]; temp[4 * i + 1] = state[4 * i + 0] ^ state[4 * i + 2] ^ state[4 * i + 3]; temp[4 * i + 2] = state[4 * i + 0] ^ state[4 * i + 1] ^ state[4 * i + 3]; temp[4 * i + 3] = state[4 * i + 0] ^ state[4 * i + 1] ^ state[4 * i + 2]; } for (i = 0; i <= 15; i++) { state[i] = temp[i]; } } void rth_Round_Encrypt_KeyAdd(int r, uint16_t *state, uint16_t *K) { int i; for (i = 0; i <= 15; i++) { state[i] = state[i] ^ K[i] ^ const_key[r][i]; } } void rth_Round_Decrypt_KeyAdd(int r, uint16_t *state, uint16_t *K) { int i; uint16_t Kr[16]; for (i = 0; i <= 15; i++) { Kr[i] = K[i] ^ const_key[r][i]; } MixColumn(Kr); Inv_ShuffleCell(Kr); for (i = 0; i <= 15; i++) { state[i] = state[i] ^ Kr[i]; } } void Encrypt(int r, uint16_t *plaintext, uint16_t *K, uint16_t *ciphertext) { int i; for (i = 0; i <= 15; i++) { ciphertext[i] = plaintext[i]; } for (i = 0; i <= 15; i++) { ciphertext[i] = ciphertext[i] ^ K[i]; } for (i = 0; i <= (r  2); i++) { SubCell(i, ciphertext); ShuffleCell(ciphertext); MixColumn(ciphertext); rth_Round_Encrypt_KeyAdd(i, ciphertext, K); } SubCell(i, ciphertext); for (i = 0; i <= 15; i++) { ciphertext[i] = ciphertext[i] ^ K[i]; } } void Decrypt(int r, uint16_t *ciphertext, uint16_t *K,uint16_t *plaintext) { int i; for (i = 0; i <= 15; i++) { plaintext[i] = ciphertext[i]; } for (i = 0; i <= 15; i++) { plaintext[i] = plaintext[i] ^ K[i]; } for (i = (r2); i >=0;i) { SubCell(i + 1, plaintext); MixColumn(plaintext); Inv_ShuffleCell(plaintext); rth_Round_Decrypt_KeyAdd(i, plaintext, K); } SubCell(i, plaintext); for (i = 0; i <= 15; i++) { plaintext[i] = plaintext[i] ^ K[i]; } } void setup (){ Serial.begin(9600); printf.begin(); } void loop () { int i,j1,j2,j3; uint16_t plaintext[16] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; uint16_t Key[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; uint16_t plaintext_temp[16]; uint16_t ciphertext_temp[16]; for (j1 = 0; j1 <= 0xff; j1++) { plaintext[0] = j1; for (j2 = 0; j2 <= 0xff; j2++) { plaintext[1] = j2; for (j3 = 0; j3 <= 0xff; j3++) { plaintext[2] = j3; /*printf("Before Encryption: "); for (i = 0; i < 16; i++) { printf("%x ", plaintext[i]); } printf("\n");*/ Encrypt(20, plaintext, Key, ciphertext_temp); printf("After Encryption: "); for (i = 0; i < 16; i++) { printf("%x ", ciphertext_temp[i]); } printf("\n"); /*Decrypt(20, ciphertext_temp, Key, plaintext_temp); printf("After Decryption: "); for (i = 0; i < 16; i++) { printf("%x ", plaintext_temp[i]); } printf("\n");*/ printf("\n"); } } } }
I reviewed the original paper numerous times, and understand the method pretty well, yet I can't pinpoint the exact reason why it's not outputting the correct cipher text, which is c055cbb95996d14902b60574d5e728d6. Any help or hints would be greatly appreciated. Thank you.
Just for reference and if it helps at all, this is the ciphertext that is output at the moment: 4d643d33500079d920dbdd42e71d3e1d. I have a sneaking suspicion that the permutations are the culprit, still not sure. The reason I think that is that the Midori64 uses similar round functions (Subcell, Mix, etc.) and it works fine; the only new introduction are the permutations and the number of rounds.

Midori error on Alpine Linux
when running Midori on Alpine Linux from the terminal I get the following error:
$ midori ** (midori4:2725): CRITICAL **: 15:46:57.727: sokoke_js_script_eval: assertion 'js_message != NULL' failed (midori4:2725): GLibCRITICAL **: 15:46:57.727: g_key_file_load_from_data: assertion 'data != NULL  length == 0' failed
Even if scripts are enabled in Midori configuration, I cannot open any page which requires scripts or java, like gmail or facebook. Since on Archlinux Midori works fine out of the box; I'd like to know what those error messages indicates. My guess is that js is not installed, but I might be wrong. Also, is there a way to verify what is missing?