2

I was interviewing for a full time position with the company I am a contractor with. One of the questions I got presented with was designing an IM client. I got asked the following question: "How would you encrypt the messages so that customer service could read them if they needed to?"

I have no experience with encryption, and did not pretend to. After the interview I went to try and find information on this so that I would have a better understanding. When I attempted to look up message encryption(how-to, example, coding, java, etc) it would only bring show articles about which app you should install to encrypt your messages, why you should use message encryption apps, etc. I couldn't find how it's done or how to implement it.

I have a basic understanding of how encryption works, but how would I go about learning more(ideally without pouring through an encryption book). I would like to understand how I could answer the question I was presented with in case I ever get an opportunity like that again.

1 Answer 1

4

How would you encrypt messages so that Customer Service could read if necessary?

  1. You encrypt the message using Customer Service's public key.

  2. Customer Service decrypt the message using their private key.

Here is a simple diagram. Imagine you are Bob and Customer Service is Alice:

enter image description here

Image Source Wikipedia: Public-key cryptography


Public Key and Private Keys

The Public and Private key pair comprise of two uniquely related cryptographic keys (basically long random numbers). Below is an example of a Public Key:

3048 0241 00C9 18FA CF8D EB2D EFD5 FD37 89B9 E069 EA97 FC20 5E35 F577 EE31 C4FB C6E4 4811 7D86 BC8F BAFA 362F 922B F01B 2F40 C744 2654 C0DD 2881 D673 CA2B 4003 C266 E2CD CB02 0301 0001

The Public Key is what its name suggests - Public. It is made available to everyone via a publicly accessible repository or directory. On the other hand, the Private Key must remain confidential to its respective owner.

enter image description here

Because the key pair is mathematically related, whatever is encrypted with a Public Key may only be decrypted by its corresponding Private Key and vice versa.

For example, if Bob wants to send sensitive data to Alice, and wants to be sure that only Alice may be able to read it, he will encrypt the data with Alice's Public Key. Only Alice has access to her corresponding Private Key and as a result is the only person with the capability of decrypting the encrypted data back into its original form.

enter image description here

As only Alice has access to her Private Key, it is possible that only Alice can decrypt the encrypted data. Even if someone else gains access to the encrypted data, it will remain confidential as they should not have access to Alice's Private Key.

Public Key Cryptography can therefore achieve Confidentiality. However another important aspect of Public Key Cryptography is its ability to create a Digital Signature.

Source Public Key and Private Keys

4
  • How would Customer service decrypt it? Wouldn't they need the private key?
    – Lencalot
    Mar 16, 2016 at 22:03
  • Customer Service use their private key to decrypt. See the finished answer.
    – DavidPostill
    Mar 16, 2016 at 22:05
  • I had the idea that the message would have issues being decrypted by the user. But the user would use the systems public key, the system could always decrypt then re-encrypt with receivers public key and send them the message. I appreciated the answer, it was exactly what I was looking for.
    – Lencalot
    Mar 16, 2016 at 22:29
  • @Lencalot You still have it wrong they wouldnt use the systems public key, which is used to encrypt the message, you should read the answer again. How the system would work, you generate the public and private key, and after the private key is downloaded and discarded by the website the public key is archived. This way, you can send encrypted messages back and forth, because you provide the sites public key, not the sites private key
    – Ramhound
    Mar 17, 2016 at 3:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .