Galactic.Cryptography Rijndael is a class that allows for the easy encryption and decryption of strings using the AES 256 encryption algorithm. Generates a random initialization vector for use by the encryption algorithm. A random array of bytes, or an empty byte array if the IV could not be generated. Generates a string representation of an array of bytes. The bytes to convert. A string representation of an array of bytes, or null if the string is too large to convert successfully. Generates a byte representation of a string generated by BytesToString(). The string to convert. A byte representation of the string, or any empty byte array if the string could not be successfully converted. Generates a random key for use by the encryption algorithm. A random array of bytes, or an empty byte array if the key could not be generated. Encrypts a string of text to an array of AES 256 encrypted bytes. The text to encrypt. The key used by the encryption algorithm. The initialization vector used by the encryption algorithm. An encrypted array of bytes, or an empty array of bytes if the string could not be encrypted. Encrypts a string of text with AES 256, and concatenates the key and initialization vector to the beginning of the string, and the length of the key and initialization vector to the end of the string. This is useful in scenarios where it is not feasible to store the key and initialization vector seperately, though not as secure. The text to encrypt. A string representation containing the key, initialization vector, and encrypted text, along with the lengths of the key and initialization vector, or a null string if the text could not be encrypted or an error occurs creating the string. Decrypts a consolidated string containing and AES 256 encrypted string, and properties of the key and initializiation vector used to encrypt/decrypt the string. The consolidated string to decrypt. The text encrypted in the consolidated string, or a null string if the text could not be decrypted or an error occurs decrypting the string. Decrypts an array of AES 256 encrypted bytes to a plain text string. The bytes to decrypt. The key used by the decryption algorithm. The initialization vector used by the decryption algorithm. The decrypted string, or null if the byte array could not be decrypted. SaltedHash is a class that generates and verifies salted hashes for cryptographic purposes. Generates a random salt using cryptographically secure algorithms. A random integer. Generates a salted hash using the supplied string data. A random integer is generated as the salt. The data to generate a hash off. A random integer used as a salt. Verifies that the supplied data string matches the value in the supplied hash. The string of data to check against the hash. The salt for this data. The hash to compare against. True if the data matches, false otherwise. Handles getting and verifying SHA256 hashes. Based on Microsoft's example code. Hash in input string and return the hash as a 32 character hexadecimal string. String to create the hash of. The hash of the string. Verify a hash against a string. The input string to verify. The hash to verify against. True if the input string matches the hash.