Is it possible to use HMAC while performing encryption of blocks?
I think that the main problem with the approach would be to get the same output size as the block, from the HMAC function.
Also, the hash function is one-way, so how would one perform the decryption?
Are there any real-world examples for this approach, or is it not feasible?
Asked
Active
Viewed 16 times
0

Ronnie1023
- 1
- 1
-
@kelalaka Thanks for your comment. Also, isn't there a problem with the fact that the hash function is one way? – Ronnie1023 Nov 04 '21 at 12:17
-
I replace every encryption operation on a block, with HMAC function. But since the hash function is one-way, when I perform the decryption on every block, there is no inverse function, or am I wrong? – Ronnie1023 Nov 04 '21 at 12:23
-
Yes, that was my question. Can I encrypt every block with hash function? Is it not possible because of what I said about the one-way property of the hashing function? – Ronnie1023 Nov 04 '21 at 12:26
-
Does these answer your question? Can I say "I have encrypted something" if I hash something? and Difference between encrypting something and hashing something – kelalaka Nov 04 '21 at 12:29
-
FYI, CTR mode is designed for PRF and we can use Hash functions to generate a keystream and encrypt like OTP manner. – kelalaka Nov 05 '21 at 20:18