System.Security.Cryptography.ProtectedData Provides methods for encrypting and decrypting data. This class cannot be inherited. Encrypts the data in a specified byte array and returns a byte array that contains the encrypted data. A byte array that contains data to encrypt. An optional additional byte array used to increase the complexity of the encryption, or null for no additional complexity. One of the enumeration values that specifies the scope of encryption. A byte array representing the encrypted data. The userData parameter is null. The encryption failed. The operating system does not support this method. The system ran out of memory while encrypting the data. Decrypts the data in a specified byte array and returns a byte array that contains the decrypted data. A byte array containing data encrypted using the method. An optional additional byte array that was used to encrypt the data, or null if the additional byte array was not used. One of the enumeration values that specifies the scope of data protection that was used to encrypt the data. A byte array representing the decrypted data. The encryptedData parameter is null. The decryption failed. The operating system does not support this method. Out of memory. Specifies the scope of the data protection to be applied by the method. The protected data is associated with the current user. Only threads running under the current user context can unprotect the data. The protected data is associated with the machine context. Any process running on the computer can unprotect data. This enumeration value is usually used in server-specific applications that run on a server where untrusted users are not allowed access.