I`ve read multiple times that it is not safe to use the shared key resulted from DH key exchange directly and that you need to do a KDF or hash over it and then use the result as a key. Why is it not safe to use the shared key directly?
From :     Importantly, the DDH assumption does not hold in the multiplicative group $\mathbb {Z} _{p}^{*}$, where $p$ is prime. This is because given $g^{a}$ and $g^{b}$, one can efficiently compute the Legendre symbol of $g^{ab}$, giving a successful method to distinguish $g^{ab}$ from a random group element.   The only way I can think of to distinguish $g^c$ from $g^{ab}$ is:    If $\left(\frac{g}{p}\right)=-1$, then $\left(\frac{g^{ab}}{p}\right) = 1$ if and only if $a$ or $b$ is even (which is $3/4$ of the times). So if $\left(\frac{g^c}{p}\right) =-1$, probably $g^c\neq g^{ab}$. Nothing is certain.   How'd do you compute $\left(\frac{g^{ab}}{p}\right)$ given $g^a$ and $g^b$?
How does deleting work? What can cause a post to be deleted, and what does that actually mean? What are the criteria for deletion? Can't find boot-repair package for the newest version of Ubuntu After upgrading Ubuntu 13.10 to 14.04, grub failed to load Ubuntu and threw the error symbol 'grub_term_highlight_color' not found. I followed the solution offered in the  but this failed for me, throwing the error failed to get canonical path of /cow.   Now, I'm trying to install Boot-Repair to fix this problem on a live pen-drive, using these commands.   sudo add-apt-repository ppa:yannubuntu/boot-repair sudo apt-get update sudo apt-get install -y boot-repair &amp;&amp; (boot-repair &amp;)   But after adding and updating the repositories, it shows ppa:yannubuntu/boot-repair 404 Not Found error.  W: Failed to fetch http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found   Is this problem solvable or is there an alternative PPA for Boot-Repair? Why do I get "Required key not available" when install 3rd party kernel modules or after a kernel upgrade? This issue happens only on UEFI systems with enabled Secure Boot.  When I try to install DKMS modules like VirtualBox, Nvidia, or Broadcom drivers, they do not install and I get Required key not available when I try to modprobe them.  VirtualBox complains that vboxdrv is not loaded.  Broadcom wl driver is shown in lspci -k as a kernel module but is not in use. sudo modprobe wl throws Required key not available.  Also this issue may happen when I install some kernel modules from git sources.  This issue may appear after a kernel update as disabled wireless adapter, black screen after a reboot, etc.   How can I fix it? Minecraft 1.7.4 server issues with loading world My primary drive is a 250GB WD SATA drive. So, I added 2x 500GB 7,200 RPM WD SATA drives into my Windows Vista box and created a 1TB RAID0. I then formatted the the primary drive and installed Windows 7. To my pleasant surprise when I booted into Windows 7 my RAID0 was still intact and I kept trotting along the same as I did before.  Now I am replacing my motherboard, processor, and RAM and plan on formatting the primary 250GB drive again and using it to boot for a new clean install of Windows 7.  My question is: if I move these two SATA drives which are setup for RAID0 into the new system, install Windows 7 again, will the RAID0 remain?  Edit: Software RAID. I created it within Windows. The RAID0 does NOT contain the system boot partition. Ignore compile errors How can I set up a permanent compile loop that keeps trying even when there are errors? I'm using latexmk with a remote compile setup as discussed  and . However, if I save a document with a bug (either a legitimate bug, or I save it before closing a tag), then latexmk halts. Any suggests how I can have it pause, try again, and keep trying again, for ever and ever? Use of inequality $1 - \cos (x) \leq x^2 /2$ In  answer the value of $1 - \cos(x)$ has to be evaluated in order to find its upper limit, if it exists.  In particular, $x = 2 \pi / n$. The answer is related to the length of a side of a regular $n$-gon inscribed into a unit-radius circumference; because the perimeter of the $n$-gon is always less than $2 \pi$, the single side must always be less than $2 \pi / n$.  The inequality  $$1 - \cos (x) \leq \displaystyle \frac{x^2}{2}$$ (1)  is used and the proof is completed with   $$2(1 - \cos(x)) \leq (2 \pi / n)^2$$  $$\sqrt{2(1 - \cos(x))} \leq 2 \pi / n$$  But it is well known that the cosine is a function $f(x) \in [-1;1]$, so $1 - \cos (x) \in [0,2]$. By using this information, we would obtain  $$1 - \cos (x) \leq 2$$ (2)  The proof would provide  $$2(1 - \cos(x)) \leq 4$$  $$\sqrt{2(1 - \cos(x))} \leq 2$$  which is a completely different result.   Why in that case it is preferable to use (1) instead of (2)? How to choose when it is convenient to use (1) and when to use (2) in a proof? When can an autonomous system be written using a Hamiltonian? I no longer use the service that I originally used to register, and would like to change the service I use to log in, or at least add a second account.  Is this possible? How do I change my login provider or associate a backup method to log in?     For more information, see "" in the . Traveling with visa in my old passport My old passport in which an ECR was stamped,with passport expiry date in 2017.I got a Dubai visit visa on its passport number but later on as I was told that it'l be a problem for me to travel to Dubai so I got a new passport re-issued with ECNR with a new passport number.  So will it be a problem for me to travel or do I have to get my UAE visit visa details of my old passport number change to my new passport number? How do I add permissions via command line for "everyone" on external HDD I have an external HDD and I kind of messed up the file permissions but when fixing it I thought it is ok bc with my username I can access the files perfectly fine. Now that I use this with two PC (actually ATM I don't have access to my other PC) I can't access these files.  The problem is this directory has hundreds of folders with no permission for "everyone". I would like to give it the default permissions including have all access for the user "everyone". How do I do that via command line for these hundreds of folders? Why doesn't PHP DOM include slash on self closing tags? Non-standard signature of main() compiles successfully Texture not appearing in render? I'm noticing a significant difference between when my objects are observable in the 3D View and when the objects are rendered.  Both objects have a material with toon settings and each have materials (incorrectly?) added to the object. the human mesh has separate textures for the head and body. The sword and the human mesh both have mapping > coordinate set to UV and Mapping > Map set to UVMap, however only the head texture seems to show up properly, and the sword texture doesn't show up at all. If a set of parentheses lies between a subject and its verb, and the parentheses contain an substitutive subject whose singularity/plurality disagrees with the original subject, whose singularity/plurality should be chosen for the verb?  In other words, in the following example, should "questions" (and its verb "are") be singular, or should they remain plural as shown?     Many (if not every) questions on this StackExchange are answered.   My intuition tells me that the two words in question should remain in plural forms, since the text in parentheses only interrupts the sentence (and the sentence would be grammatically incorrect if everything in parentheses were removed and the words were in singular form).  On the other hand, when read aloud (assuming one reads the text in parentheses), this has an uncomfortable sound to it, and I've seen others write in what would be the above example's singular-form case, so I'm curious to find out which is correct.  And, thinking about it, I suppose the same question would apply when commas are used in place of parentheses. To show that $2$ | $x^{2n} - x^n$, $n \in \mathbb{Z^+}$ is the following adequate? EmployeeNumber = string.IsNullOrEmpty(employeeNumberTextBox.Text)     ? null     : Convert.ToInt32(employeeNumberTextBox.Text),  I often find myself wanting to do things like this (EmployeeNumber is a Nullable&lt;int&gt; as it's a property on a LINQ-to-SQL dbml object where the column allows NULL values).  Unfortunately, the compiler feels that  There is no implicit conversion between 'null' and 'int'  even though both types would be valid in an assignment operation to a nullable int on their own. Using the null coalescing operator is not an option as far as I can see because of the inline conversion that needs to happen on the .Text string if it's not null. As far as I know the only way to do this is to use an if statement and/or assign it in two steps.  In this particular case I find that very frustrating because I wanted to use the object initializer syntax and this assignment would be in the initialization block... Does anyone know a more elegant solution? Probability, quantum physics, and why (can't it/does it) apply to macroscale events? Quantum physics dictates that there are probabilities that determine the outcome of an event, ie: the probability of a quark passing through a wall is X, due to the size of the quark in comparison to the wall), but couldn't macroscale events be predicted this same way, assuming all variables were accounted for (lets hypothetically say we have a computer powerful enough to take into account all factors).  My understanding is that as the scale of an object increases, the probability of it doing anything other than what classical physics dictates is almost 0%, but could conceivably do something not predicted (Example: a human being cannot pass through a wall, but given an infinite timescale, eventually s/he would because of probability not being 0). Is this accurate? If so, then shouldn't we, (except as a tool for conceptualization, like how we round 9.8 m/s^2 or pi to 3.14), use only quantum mechanics to explain events in any scale (for more accuracy)? So the stories of the Hunger Games are set in , a post-apocalyptic society situated in North America. Is there anything to explain what caused the Apocalypse? Whether from the main books, any extra material or interviews? (No fanfic please.)  As well as the cause, is there any indication of when the apocalypse happened? And how long after the apocalypse are the events of the Hunger Games? iPhone asks for Mac password (or Mac asks for iOS password) During iPhone update to iOS 10.3.1, I was asked for my password using the correct machine name for my Mac mini. To be clear, the request was not for my iCloud password, my actual local user account password for macOS. This can also happen in the other direction - setting up a Mac may ask for verification for you to enter your iPhone / iPad passcode (and not your iCloud password)  I could not find any information about this kind of access. I was thinking it was security for iCloud and possibly related to two step authorization or two factor authorization. This is the first time I can think of that I entered a desktop password outside of that actual desktop.  I don't have a screen shot but I recall an implication that some files in my Mac are encrypted and need my password. '... need to enter the password for .'   Are there settings I can I control this assuming it's a legitimate part of iCloud setup process or iOS setup process?