-1

I would like to encrypt a string with keyA then encrypt the result with keyB then decrypt that result with keyA and finally retrieve original string with keyB.

I am using VB6 and/or VB.net

TylerH
  • 20,799
  • 66
  • 75
  • 101

1 Answers1

1

Use CTR mode encryption such as the one used in Bouncy Castle for .NET. CTR uses XOR as last step, and XOR is commutative.

Community
  • 1
  • 1
Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
  • Note that I won't go into the details why you want to do such a thing, double encryption is not very useful most of the time (at least not for data, you could however encrypt a data key multiple times). – Maarten Bodewes May 27 '14 at 21:16