0

I need help, I want to send a encrypted SMS from Alice to Bob, where does hashing comes in here? How do I use the hashing??

2
  • 1
    Could you provide some more information? Do you have a specific protocol in mind? Have you tried to find the answer yourself? Why do you think hashing is involved?
    – Sjoerd
    Feb 2, 2017 at 19:12
  • 1
    How are you encrypting? Why should there be hashing?
    – Matthew
    Feb 2, 2017 at 19:13

1 Answer 1

2

Hashing, or really a Message Authentication Code (MAC) in this instance, would not be used in encrypting the message per se, but would be used to verify that the message had not been tampered with while in transit.

A traditional hashing function is a one-way function which takes an input (the text of your SMS message, in this case) give a unique output for that input. The same hashing function applied to the same input will always product the same output. A good hashing function is one that is mathematically easy to go from input to output, but is mathematically difficult to go from output back to the orginal input.

A Message Authentication Code is similar to a traditional hash in that it's difficult to go from output back to input, but it also takes a private key. This means that two users can take the same MAC function, put in the same data, but get two completely different results if the private keys do not match. The recipient of the message can then use the senders public key to validate that the sender was indeed the person that sent the message.

Building crypto systems is very hard to do correctly. If you need to communicate securely by phone, I would recommend that you use an existing, peer-reviewed app such as Signal.

2
  • I want encrypt the sms, then hash a copy of the encrypted sms with SHA256 and sign it with NTRUSign, then combined the encrypted message with the signed message and send it to the receiver. The receiver's messaging app will separate the encrypted sms from the signed sms. Then hash a copy of the encrypted sms signed it with the senders NTRUSign public key to verify signature, remove the signature and very the hashed values. Before finally decrypting his encrypted message. Feb 3, 2017 at 20:55
  • It sounds like hashing is unnecessary at this point. The whole point of that signature is to serve as the MAC that I was talking about. Feb 3, 2017 at 21:23

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