# ElGamal recovering messages

If you use the same ephemeral key in Elgamal, someone can read the future messages. I have two ciphertexts $y_1=62$ and $y_2=4$. The difference between two plaintexts is $x_1-x_2=138$

how do I get $x_1$ and $x_2$? Modulo is $157$

Replay

Because the current answers may be a bit cryptic, I'll make a quick write-up of the solution of this one, as the asker has already figured out the solution and the way himself.

First thing to notice: $y_1=x_1\cdot h$ and $y_2=x_2\cdot h$, where $h$ is $g^{ak}$ where $a$ is the recipient's private key and $k$ is the ephemeral key of the message, it's assumed static for this. Let $p$ be the known modulus.

First note that $y_1-y_2=x_1\cdot h-x_2\cdot h=(x_1-x_2)\cdot h\pmod p$ and thus $(y_1-y_2)\cdot(x_1-x_2)^{-1}=h\pmod q$, where $x_1-x_2$ is known. Using this one can recover $x_1=y_1\cdot h^{-1}\pmod p$ and $x_2=y_2\cdot h^{-1}\pmod p$ using the extended euclidean algorithm.

Category: elgamal encryption Time: 2016-07-28 Views: 0

## Related post

• How can I recover messages that have been deleted from trash? 2014-11-02

I lost some mails from my Gmail and by mistake. They are permanently deleted from my trash. What can I do to get them back? --------------Solutions------------- If this is a private Gmail account (@gmail.com), there's nothing much you can do. If you

• MSMQ Disaster Recovery - How to recover message queues from a crashed machine? 2012-05-24

How can message queues be recovered from a crashed machine, so that transactional messages can be restored on a new machine? --------------Solutions------------- Stop the MSMQ Service on both source and destination machines: net stop MSMQ Delete the

• Recover Messages content after clean install of El Capitan 2015-11-27

I've done a clean install of El Capitan. I do have a raw file back up of my home folder, containing the messages archive. This was created when I was in Yosemite. I grabbed the entire contents of the Home folder (/Users/myusername). This includes the

• How can WhatsApp recover messages sent to a drowned phone? 2016-06-16

My mom has an Android phone that fell in the water for a couple of seconds, around 16:30. She managed to disassemble the phone and turn it off. We both share a group that is end-to-end encrypted (all participants have new WhatsApp versions). The same

• How can WhatsApp recover messages sent to a damaged phone? 2016-06-16

My mom has an Android phone that fell in the water for a couple of seconds, around 16:30. She managed to disassemble the phone and turn it off. We both share a group that is end-to-end encrypted (all participants have new WhatsApp versions). The same

• Is it possible to recover deleted text messages after a factory reset on LG Optimus One 2.2.1? 2013-10-07

I have never backed up anything off my phone. The text messages I need are from within the last month. The factory reset was done a week ago.. --------------Solutions------------- Alas, the SMS are all gone, they're part of the data that gets wiped a

• Inbox messages are gone from Outlook Express 6 - Inbox.dbx too big 2010-10-24

My Father uses Outlook Express 6 and had thousands of messages in his inbox. Suddenly Outlook Express says the inbox is empty. I think it kind of overflowed. The inbox points to a .dbx file with a size of 1,99 GB. Is there a way to restore those mess

• Decrypt a message which is encrypted using XOR? 2011-07-13

Suppose Alice wants to send encryptions (under a one-time pad) of $m_1$ and $m_2$ to Bob over a public channel. Alice and Bob have a shared key $k$; however, both messages are the same length as the key $k$. Since Alice is extraordinary lazy (and doe

• When to use RSA and when ElGamal asymmetric encryption 2012-01-17

If i am not wrong in cryptography there are 2 basic cryptographic schemes for public key cryptography. RSA encryption whose security is based on the infeasibility of solving the factoring of big primes problem and the ElGamal encryption which is as s

• "Display driver stopped responding and has recovered" after computer is idle 2012-04-23

Often when I leave my computer for a while (more than about 3 or 4 minutes, at a guess) the graphics driver will crash when I come back to it. The screen goes black for several seconds then comes back with a little popup in the bottom right saying "D

• Using bad generator in ElGamal Encryption 2012-06-29

Suppose Alice chooses a random Prime $p$ and a random private Key $a \in \mathbb{Z}^*_p$. By accident, she also chooses a random number $g \in \mathbb{Z}^*_p$, which is not a generator of $\mathbb{Z}^*_p$ and therefore \langle g\rangle \subset \mat

• Encryption of chat messages and possibility of password loss 2012-08-24

I have a client-server chat like app. I would like to add an encryption of messages for users. So, that they will be sure that no one, even service owner, can read their confidential information. I'm going to use AES cryptography like this http://bit

• Why elgamal is still discussed 2013-07-31

As I understand, if two users have a shared key, it is possible to encrypt a message using symmetric key encryption. So when a secret key is shared through Diffie-Hellman asymmetric key exchange, it means that the users have their shared key. So why

• How long are text messages saved in the iCloud server? 2014-04-09

..and how can I get rid of them before they are subpoenaed? --------------Solutions------------- It's unclear how long the messages are stored after transmission through iMessage. But there are plenty of places to find the messages if truly needed. F

• How to use ElGamal to encrypt zero? 2014-12-20

ElGamal encryption algorithm is as follows: To encrypt a value $m$, it chooses a random value $r$, and calculates $c_1=g^r$ $mod$ $q$ $c_2=m*h^r$ $mod$ $q$ where $g$ is the group generator, $x$ is the private key and $h=g^x$ is the public key. But if

• Are rejection messages stored anywhere on a postfix server? 2015-12-01

I am working, with very limited experience, to recover messages that were sent to an address on a postfix email server that had been forwarded to a bad address. So the messages were rejected, but were attached to the rejection notice. A sample reject

• GMail IMAP + Apple Mail / iPhone - "Account exceeded bandwidth limits. (Failure)" 2009-09-04

Started seeing this this morning in Apple Mail. I have one of those exclamation point error indicators next to "Inbox", with this error message when I click on it: There may be a problem with the mail server or network. Verify the settings for a

• Merging multiple SMS databases 2010-10-17

I have a lot of problems with my phone, and so I have a number of nandroid backups with different sets of overlapping SMS messages saved in them. I've also made a few copies of the data folder when the thing wouldn't boot. I like to have all my SMSes

• How to decrypt a text which is ciphered same length key? 2011-07-13

Suppose Alice wants to send encryptions (under a one-time pad) of $m_1$ and $m_2$ to Bob over a public channel. Alice and Bob have a shared key $k$; however, both messages are the same length as the key $k$. Since Alice is extraordinary lazy (and doe

### server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 2.514 (s). 13 q(s)