Hello,
Im using that kind of sub with StringUtils and B4XCipher library to encode some passwords :
but for URL, if these chars / + = are eventually returned, which could generate some pbs when passing in URL,
- If yes, should i replace by myself that chars (by replacing character 62 and 63 with - and _ respectively)
- or is there an EncodeBase64URL methode
- or otherwise
Regard
Michel
Im using that kind of sub with StringUtils and B4XCipher library to encode some passwords :
B4X:
Sub EncryptText(text As String, password As String) As String
Dim c As B4XCipher
Dim su As StringUtils
Return su.EncodeBase64(c.Encrypt(text.GetBytes("utf8"), password))
End Sub
Sub DecryptText(EncryptedData As String, password As String) As String
Dim c As B4XCipher
Dim su As StringUtils
Dim b() As Byte = c.Decrypt(su.DecodeBase64(EncryptedData), password)
Return BytesToString(b, 0, b.Length, "utf8")
End Sub
but for URL, if these chars / + = are eventually returned, which could generate some pbs when passing in URL,
- If yes, should i replace by myself that chars (by replacing character 62 and 63 with - and _ respectively)
- or is there an EncodeBase64URL methode
- or otherwise
Regard
Michel
Last edited: