There are two parties, and each has a list of plain-texts. My end goal is to assign indices to unique plain-texts across both parties. My present approach is the following.
Both parties perform a Diffie-Hellman key exchange to generate a secret key (which is the same for both workers).
Then they encrypt the plain-texts using AES in ECB mode using the secret key.
The set of encrypted plain-texts is brought to my local machine. (Note that I bring a set, thus each encrypted text returned by a given party is unique.)
I compare them and assign unique indices to each of them.
The deterministic property of ECB mode, plays an important role here, as it helps to compare similar plain-texts encrypted with the same key.
But I understand (after reading multiple answers about it) that ECB mode has many weaknesses. For example, two plain-texts longer than 16 characters, having the same characters after the 16th character will have the same ending block in the encrypted text. The same logic applies to the first 16 characters as well.
I want to know, if there are other ways in which I can extract information about the plain-texts of both parties, by analyzing the encrypted texts returned by them to me.
And is there any other more secure way to achieve my end goal?