Alegere metoda criptare

Discutii despre tot ce nu se incadreaza in celelalte categorii.

Moderators: Moderatori ajutatori, Moderatori

Post Reply
User avatar
sergiu4995
Membru eXtream
Membru eXtream
Posts: 2007
Joined: 08 Oct 2011, 20:05
Detinator Steam: Da
Has thanked: 27 times
Been thanked: 14 times
Contact:

13 Jan 2021, 23:39

Salut pana acum folosesc pentru criptarea parolelor bcrypt din php si din programelele din c# folosesc o librarie, intrebarea mea se merita aceasta metoda? ca mie sa nu mai fie libraria disponibila.
Daca aveti sugestii cu o metoda mai eficienta, chiar va rog, sa luam in calcul acele care au coleziuni gen md5
User avatar
The Kalu
eXtream Mod
eXtream Mod
Posts: 12881
Joined: 09 Oct 2010, 11:39
Detinator Steam: Da
CS Status: In grajd!
SteamID: kalulord
Reputatie: Fost membru Club eXtreamCS (6 luni)
Nume anterior: Terra
Location: Romania, Ploiesti
Has thanked: 225 times
Been thanked: 445 times
Contact:

14 Jan 2021, 10:13

https://github.com/phpseclib/phpseclib/ ... jndael.php

C# decrypt ()

Code: Select all

 private string decyptInit(string toBeDecrypted, string key, string initVector)
    {
        var keyByte = Encoding.Default.GetBytes(key);
        var decodedIV = Base64Decode(initVector);
        var iv = Encoding.Default.GetBytes(decodedIV);

        var rijndael = new RijndaelManaged
        {
            BlockSize = 128,
            IV = iv,
            KeySize = 192,
            Key = keyByte
        };

        var buffer = Convert.FromBase64String(toBeDecrypted);
        var transform = rijndael.CreateDecryptor();
        string decrypted;
        using (var ms = new MemoryStream())
        {
            using (var cs = new CryptoStream(ms, transform, CryptoStreamMode.Write))
            {
                cs.Write(buffer, 0, buffer.Length);
                cs.FlushFinalBlock();
                decrypted = Encoding.UTF8.GetString(ms.ToArray());
                cs.Close();
            }
            ms.Close();
        }

        return decrypted;
    } public static string Base64Decode(string base64EncodedData)
    {
        var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData);
        return System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
    }
User avatar
sergiu4995
Membru eXtream
Membru eXtream
Posts: 2007
Joined: 08 Oct 2011, 20:05
Detinator Steam: Da
Has thanked: 27 times
Been thanked: 14 times
Contact:

14 Jan 2021, 16:28

Ms, dar ideea e ca se merita de stat la bcrypt? e eficient sau sunt mai bune la care ati testat voi
Post Reply

Return to “Discutii generale”

  • Information