Decrypting the same message with the same IV using aes-256-cbc Is it safe to use the same IV when decrypting the exact same encrypted message. From my understanding, there is a security flaw when using the same IV for numerous different messages, as attackers can deduce patterns.
Also is aes-256-cbc the correct encryption method and mode for this scenario. If not, which ones are better?
First of all IV is decided while encrypting, you must decrypt using the same IV that was used during encryption. So, the question should really be about encrypting same message with same IV not about decrypting.
In CBC mode, using same IV and same key for different messages can help you detect the common prefixes in the message which diverges after encountering the first different block. That's why using same IV is never semantically secure as you can easily see where the messages diverge, that is information is leaked even if you are not allowed to repeat messages. Back to the question and similarly, using same IV and key for the same message will always produce same ciphertext, thus you can easily see repeated encrypted message for seen ciphertext. If this much of information reveal is acceptable to you, it's OK but it may not be OK to everybody.
There is no &quot;correct&quot; encryption mode in this scenario, it depends on what type of security you want and is important that you know the risks involved. CBC mode has some flaws and should not be used unauthenticated. It is vulnerable to bit flipping attacks (flipping bits on ciphertext produces predictable change in the next block) and can be devastating if the application accepts random block just before the targeted block or if it is the first block (in which case you can achieve the same by bit-flipping the IV). Similarly, it may be vulnerable to padding oracle attacks depending on what type of system it is used with and what kind of information it reveals deliberately or unwittingly. My best advise is using authenticated encryption modes like GCM or GCM-SIV.
Using same IV on different message wouldn't be as bad in CBC mode as it would be for CTR or OFB or GCM mode (for these, consequences can be devastating) and using same IV for same message in these modes would pose the same problem, detection of repeated messages due to repeated ciphertext and it all depends on whether if they are OK with it.