Home Forums WinForms controls Xceed Grid for WinForms Varied results when encrypting the same string with the same key.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17791 |

    The reason why you get different results with the same key, same string, is because of the PadingMethod property.

    Rijndael will encrypt 16 bytes of data at a time. Lets say your data is 40 bytes. The first 32 bytes will be encrypted with the same result. But, your final 8 bytes will be padded with an extra 8 (a resulting 16 bytes). These padded 8 bytes will always be different, unless you set the PaddingMethod Property to epmRFC1423 (see the help file under PaddingMethod Property). Your final result will now be of 48 bytes. 16 + 16 + 8 + 8 final 8 being your padded result.

    If you use the Chained Blocks encryption mode and you provide a different initialization vector each time (recommended), then the entire resulting encrypted string will be different.

    Imported from legacy forums. Posted by Xceed admin (had 768 views)

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.