Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Function Encrypt(data As Byte(), key As AsymmetricKeyParameter) As Byte()
- Dim engine = New RsaEngine()
- engine.Init(True, key)
- Dim blockSize = engine.GetInputBlockSize()
- Return engine.ProcessBlock(data, 0, blockSize)
- End Function
- Public Function Decrypt(data As Byte(), key As AsymmetricKeyParameter) As Byte()
- Dim engine = New RsaEngine()
- engine.Init(False, key)
- Dim blockSize = engine.GetInputBlockSize()
- Return engine.ProcessBlock(data, 0, blockSize)
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement