Sign documents with standard encryption for QR-code

GroupDocs.Signature provides ability to encrypt QR-code signature with symmetric algorithms. Class SymmetricEncryption implements one of the following values algorithms (DES, TripleDES, RC2, Rijndael or AES), string value key and string value salt.

Here are the steps to encrypt QR-code text with embedded encryption by GroupDocs.Signature:

How to encrypt QR-code signature

This example shows how to encrypt QR-code signature.

using (Signature signature = new Signature("sample.pdf"))
{
    // setup key and passphrase
    string key = "1234567890";
    string salt = "1234567890";
    // create data encryption
    IDataEncryption encryption = new SymmetricEncryption(SymmetricAlgorithmType.AES, key, salt);
    // setup QR-Code options
    QrCodeSignOptions options = new QrCodeSignOptions()
    {
        // set QR-code text
        Text = "This is secure text that will be encrypted",
        // QR-code type
        EncodeType = QrCodeTypes.QR,
        // specify serialization encryption
        DataEncryption = encryption,
        // locate and aligh signature
        Height = 100,
        Width = 100,
        VerticalAlignment = VerticalAlignment.Bottom,
        HorizontalAlignment = HorizontalAlignment.Right,
        Margin = new Padding() { Right = 10, Bottom = 10 }
    };
    // sign document to file
    signature.Sign("QrCodeEncrypted.pdf", options);
}

More resources

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App

Along with full-featured .NET library we provide simple, but powerful free Apps.

You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online GroupDocs Signature App.