Common cryptography tasks

May 28, 2026 ยท View on GitHub

These articles provide example code for common WinRT cryptography tasks, such as creating random numbers, comparing buffers, converting between strings and binary data, copying to and from byte arrays, and encoding and decoding data.

TopicDescription
Create random numbersThis example code shows how to create a random number or buffer for use in cryptography in a WinUI app.
Compare buffersThis example code shows how to compare buffers in a WinUI app.
Convert between strings and binary dataThis example code shows how to convert between strings and binary data in a WinUI app.
Copy to and from byte arraysThis example code shows how to copy to and from byte arrays in a WinUI app.
Encode and decode dataThis example code shows how to encode and decode base64 and hexadecimal data in a WinUI app.