vb.net

How to create symmetric encryption utility class in ASP.NET in VB.NET

Symmetric encryption algorithms use one key for encrypting and decrypting data. You can create a utility class that performs the encryption and decryption of sensitive data:

Imports System

Imports System.IO

Imports System.Text

Imports System.Security.Cryptography

 

Public NotInheritable Class SymmetricEncryptionUtility

Private Sub New()

End Sub

Private Shared _ProtectKey As Boolean

Private Shared _AlgorithmName As String

‘ You can …

Learn more

How to manage secret keys in ASP.NET

Microsoft Windows supports a built-in way for storing and protecting secrets and it uses a machine key generated with the system installation for encrypting data. Only the local operating system has access to this machine key which is unique for every installation. Windows supports the DPAPI for protecting data with this key. You don’t have direct …

Learn more

The .NET CryptoStream class in VB.NET

The CryptoStream wraps an ordinary stream and uses an ICryptoTransform. The CryptoStream have the following key advantages:

– You can use automatic encryption without worrying about the block size required by the algorithm, because the CryptoStream uses buffered access.

– CryptoStream wraps an ordinary .NET stream-derived class and you can …

Learn more

The .NET ICryptoTransform interface in VB.NET

The ICryptoTransform interface represents blockwise cryptographic transformation which could be an encryption, ecryption, hashing, Base64 encoding/decoding, or formatting operation.  You can create an ICryptoTransform object for a given algorithm by using the:

– CreateEncryptor() method – if you want to encrypt data.

– CreateDecryptor() method – if you want to encrypt data.

 

The next code …

Learn more

The .NET abstract encryption classes

The .NET abstract encryption classes provide the following:

1. They define the basic members that encryption implementations need to support.

2. They offer some functionality through the static Create() method, which you can use to indirectly create …

Learn more

How to generate cryptographically strong random numbers in VB.NET

You can create strong random number values with the System.Security.Cryptography.RandomNumberGenerator class. You use these random key or salt values when you want to store salted password hashes. A salted password hash is a hash created from a password and a so-called salt where salt is a random value. This guarantees that even if two users select …

Learn more

How do Windows certificate stores work

Windows supports several types of certificate stores that are called store locations. You can create a separate store for each Windows service of a machine, and every user has a separate certificate store. Certificates are kept securely in those stores. The local machine store is encrypted with a key managed by the local security authority of …

Learn more

How to read X509 certificates in VB.NET

X509 certificates play an important role in the world of the Web, because they establish SSL communication and perform certificate authentication to secure traffic between the web server and its clients. Our site provides more details in the articles How does Secure Sockets Layer (SSL) technology work, How do certificates work and How does …

Learn more

How to use the Roles API with Windows authentication in ASP.NET in VB.NET

The roles API  ships a provider that integrates with Windows roles for Windows authentication: the WindowsTokenRoleProvider. This provider retrieves the Windows group membership information for the currently logged-on user and provides it for your application. When using the WindowsTokenRoleProvider, you have to configure your application using Windows authentication and then configure the WindowsTokenRoleProvider as follows:

 

<configuration>

Learn more

How to perform authorization checks for Role-Based authorization in ASP.NET in VB.NET

When you enable the roles API, by following the approach described in the article How to use Roles API for Role-Based Authorization in ASP.NET, the RoleManagerModule automatically creates a RolePrincipal instance. This instance contains both the authenticated user’s identity and the roles of the user. The RolePrincipal is a custom implementation of IPrincipal, which is the …

Learn more