
Convertir a codigo JAVA para android
Publicado por Javi (9 intervenciones) el 19/05/2017 13:21:48
Me han pasado este código que sirve para desencriptar, pero no se como pasarlo a JAVA e implementarlo en android studio, haber si alguien puede ayudarme o guiarme un poco. Saludos y Gracias.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//PRINCIPIO
Public Function Desencripta(Cadena As String) As String
Dim inputBytes As Byte() = Convert.FromBase64String(Cadena)
Dim resultBytes As Byte() = New Byte(inputBytes.Length - 1) {}
Dim textoLimpio As String = [String].Empty
Dim cripto As New RijndaelManaged()
Using ms As New MemoryStream(inputBytes)
Using objCryptoStream As New CryptoStream(ms, cripto.CreateDecryptor(Clave, IV), CryptoStreamMode.Read)
Using sr As New StreamReader(objCryptoStream, True)
textoLimpio = sr.ReadToEnd()
End Using
End Using
End Using
Return textoLimpio
End Function
//FINAL
Valora esta pregunta


0