I have some .net code to generate hash key for encryption, i want to that code in iOS but i can't found appropriate solution, If anyone have the proper solution please help me
i add the my .net code and it is working fine, i want to convert that code in iOS with same result
Public Shared Function Encrypt(ByVal plainText As String) As String
Dim passPhrase As String = "passPhrase"
Dim saltValue As String = "saltValue"
Dim hashAlgorithm As String = "SHA256"
Dim passwordIterations As Integer = 2
Dim initVector As String = "abc123def456gh78"
Dim keySize As Integer = 256
Dim initVectorBytes As Byte() = Encoding.ASCII.GetBytes(initVector)
Dim saltValueBytes As Byte() = Encoding.ASCII.GetBytes(saltValue)
Dim plainTextBytes As Byte() = Encoding.UTF8.GetBytes(plainText)
Dim password As New PasswordDeriveBytes(passPhrase, saltValueBytes, hashAlgorithm, passwordIterations)
Dim keyBytes As Byte() = password.GetBytes(keySize \ 8)
End Function