How encrypt and decrypt integer value in linq devexpress blazor

61 views Asked by At
    public string GetQCAsync(string UserLimit)
    {
        var DSet1 = _context.test.Where(x => x.Uid == 1).FirstOrDefault();

        var provider = new System.Security.Cryptography.RSACryptoServiceProvider();
        //provider.ImportParameters("aXb2uy4z");

        DSet1.NoOfUsers = provider.Encrypt(
            System.Text.Encoding.UTF8.GetBytes(UserLimit), true);

        string decryptedTest = System.Text.Encoding.UTF8.GetString(
            provider.Decrypt(DSet1.NoOfUsers, true));

        return decryptedTest;
    }

i tried this but this won't work i want to get integer value and to encrypt it and save the encrypted value in sql while saving and i have to get the actual[decrypted] value when edit

0

There are 0 answers