PasswordDeriveBytes::GetBytes Method (Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

obsoleteCodeEntityM:System.Security.Cryptography.Rfc2898DeriveBytes.GetBytes(System.Int32) Note: This API is now obsolete.

Returns pseudo-random key bytes.

Namespace:   System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

[ObsoleteAttribute("Rfc2898DeriveBytes replaces PasswordDeriveBytes for deriving key material from a password and is preferred in new applications.")]
virtual array<unsigned char>^ GetBytes(
	int cb
) override


Type: System::Int32

The number of pseudo-random key bytes to generate.

Return Value

Type: array<System::Byte>^

A byte array filled with pseudo-random key bytes.

This method can create any number of pseudo-random bytes. However, the strength of the byte sequence is limited by the number of bytes in the hash output.

.NET Framework
Available since 1.1
Return to top