Decode aes với C# , php

Discussion in 'Hỏi Đáp Kỹ Thuật' started by Hoa Mãn Lâu, Jun 27, 2021.

  1. Hoa Mãn Lâu

    Hoa Mãn Lâu Trưởng Môn

    Mình decode bằng js với file html nầy thì khá ổn
    Code:
    <html >
    <head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js"></script>
    </head>
    <body>
    <script>
    var o = CryptoJS.AES.decrypt("U2FsdGVkX18svGG2EKplXvP8vxIfzpKF1hnCf9mWUMIAdcwBWlrYrpQuAx4voRM7Xcknm9PU6DWcM9u/GKTvY4TJDQ8jQ8aMe0AmUbQ/KyEI7nsFVHAdWA9YvVzdGO+4z64RQ7VyZA0EmMs4VZNuqa5nLO+2Yluwx0Z8WTLNQdGtdCZSVGt2SAGra8iUXmiGh5g2FgWaa8jMezghfpEzfHAqWaHvOqjWI0wjbt1t8nBKaAfIAHPW9+09+oEeajmZJKOSAH4w4hV17tRzsedJMHJhyn6lccDOuvOqtjtkIoClwwd3TzVlLoNpraiE1nOsj0b2npZne1q4jnMzIDM9ztP2ZT9JOzYEmXFkToJZTMrdef+n08pAGm/1yPYnKX8p5YU4Zk2AGUgVtznVr6niw5R498yY67raZuNmrMCIYs7j0EERLcGgqWefsdXZyOkELZGQRjbAZuM37dN1/0/hOEdC0dD8X90lJmi8AAJ4BFv6DhK12DZFNWBKdjbtu0nWYSbquHAYFqlKd+SCdHc0gewpOvJ0sW0nEMQ0ZAV1kIvtBSNGnd/Lz/8rhGGs4MY6ey0HUvT7c4kFZX/ChsaB3rQ9pvoV2+l9zXsyfv3f6FTtoXyje5/XfcnXQsEY25E+XOaMwd6n0KRn8NrOuNK+QGlO6U57NYlt/d2+AsCEn/dlMzuDHJTAzkahXscFNaOjCOhVtcQkaGXegRRKFHxknJnff2o7QjLrptp2XcAKZPTvnrzkxGV9zoxU34v4jG7HbYCNsP4LN/9wacbcRVWdg0tRC5UwxV9mDk9MbJWAiOriJ/ZNRi4H1HSWgCJB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lpHYlhGSva9AQBx/BK3p9EbOS4rjETfKkm7knCX6Ftqsc6vXd6ES7ecKwQB2JUf/p3ka4yVbwHAQ7Y4NlBpz2zykN6bJ04U4TAn0Hk9+DVOXLP/P03jgQ/LtfvZgXx2n/DviEOMrsctkQG2nwN67OsxGVY/l7v+iDrjZ0tATyK+zTxn0zO020MMwwSHyzOWXsAxH5gGpiVxmH/CsnShEzvbj1LpTGsO58GMYD1ElQBuY6Bjmz2+Sh0zRJCyFgHvpJvhibi7oAeVBNtvasntIzeuvHwgCdymjtbYcn+WMCAi7OC6BNRf0E+8tDJIO7UFdg8FQohy6xzihPv7vLFj+dJJj02J6UYWugIhKx+DXZuYXxcxVwLEI/7Ukw8FouVfPcx8yQ7VRGpXh5LZKzpYQU9JTOY77QcXN9w6BhnvXphV1SPUIz0wxvYyAA2XXgpTYjVLPqlw729I29TWKY7WbK/yHBkpMZESWO9YrWnzlxxgXCUinnU1fFzuQr+mT0QSCAgemGHCZjLmIqoYeRb7vnoc3tRWVtiL6fjkzMIcP3Wp4PAALBnIFrJ9G/9WBQNlLnFciBBm7ll0GjCjT8KTBvTHofDuatdlfef2iAaphDjj8BMovt5DUDBn2Q4MicnWgxVfI0rq5VVifoPBu34GSv2FdJWRHr7hBEvxsGdxWyWsLXecZIuImdl82w/pgAbg1l73r+uoY7RjmGuHi2rZVBKvd1nEe/D92OCnlIX1X3X4NntNc0Nn1ujNbr1rtF5bZOKF7jvBjBz6vNUpuCyJCt7v0+3w1V83tws5riMXZZRiGwhLoPMVYQG9PENI/CiTO6ZEapEr0Q/M7DnS8KD6K7wEI+gZi3OkK0G+wDr01uTb4AglP9pzvsv3Ex0lQ==", "2a03f1c954abfd1e06acc4b97b19dbba").toString(CryptoJS.enc.Utf8);
    alert(o);
    </script>
    </body>
    </html>
    Nhưng mà muốn decode với php hoặc C# thì mình vẫn chưa tìm được lib nào chạy ra dc kết quả, nó chỉ ra 1 đoạn mã vô nghĩa như hình
    [​IMG]
    Có pác nào đã làm phần nầy rồi, chỉ giáo mình 1 với
     
  2. sincos

    sincos Bang Chúng

    Last edited: Jun 27, 2021
    Newbie88 and Hoa Mãn Lâu like this.
  3. firefox

    firefox Bang Chúng

    của bác đây:
    https://dotnetfiddle.net/xjIdxF

    PHP:
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Security.Cryptography;
    using System.Text;

    namespace 
    TestEas
    {
        class 
    Program
        
    {
            static 
    void Main(string[] args)
            {
                var 
    encryptedText "U2FsdGVkX18svGG2EKplXvP8vxIfzpKF1hnCf9mWUMIAdcwBWlrYrpQuAx4voRM7Xcknm9PU6DWcM9u/GKTvY4TJDQ8jQ8aMe0AmUbQ/KyEI7nsFVHAdWA9YvVzdGO+4z64RQ7VyZA0EmMs4VZNuqa5nLO+2Yluwx0Z8WTLNQdGtdCZSVGt2SAGra8iUXmiGh5g2FgWaa8jMezghfpEzfHAqWaHvOqjWI0wjbt1t8nBKaAfIAHPW9+09+oEeajmZJKOSAH4w4hV17tRzsedJMHJhyn6lccDOuvOqtjtkIoClwwd3TzVlLoNpraiE1nOsj0b2npZne1q4jnMzIDM9ztP2ZT9JOzYEmXFkToJZTMrdef+n08pAGm/1yPYnKX8p5YU4Zk2AGUgVtznVr6niw5R498yY67raZuNmrMCIYs7j0EERLcGgqWefsdXZyOkELZGQRjbAZuM37dN1/0/hOEdC0dD8X90lJmi8AAJ4BFv6DhK12DZFNWBKdjbtu0nWYSbquHAYFqlKd+SCdHc0gewpOvJ0sW0nEMQ0ZAV1kIvtBSNGnd/Lz/8rhGGs4MY6ey0HUvT7c4kFZX/ChsaB3rQ9pvoV2+l9zXsyfv3f6FTtoXyje5/XfcnXQsEY25E+XOaMwd6n0KRn8NrOuNK+QGlO6U57NYlt/d2+AsCEn/dlMzuDHJTAzkahXscFNaOjCOhVtcQkaGXegRRKFHxknJnff2o7QjLrptp2XcAKZPTvnrzkxGV9zoxU34v4jG7HbYCNsP4LN/9wacbcRVWdg0tRC5UwxV9mDk9MbJWAiOriJ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j0rK6CPueR4xFG8n/lpHYlhGSva9AQBx/BK3p9EbOS4rjETfKkm7knCX6Ftqsc6vXd6ES7ecKwQB2JUf/p3ka4yVbwHAQ7Y4NlBpz2zykN6bJ04U4TAn0Hk9+DVOXLP/P03jgQ/LtfvZgXx2n/DviEOMrsctkQG2nwN67OsxGVY/l7v+iDrjZ0tATyK+zTxn0zO020MMwwSHyzOWXsAxH5gGpiVxmH/CsnShEzvbj1LpTGsO58GMYD1ElQBuY6Bjmz2+Sh0zRJCyFgHvpJvhibi7oAeVBNtvasntIzeuvHwgCdymjtbYcn+WMCAi7OC6BNRf0E+8tDJIO7UFdg8FQohy6xzihPv7vLFj+dJJj02J6UYWugIhKx+DXZuYXxcxVwLEI/7Ukw8FouVfPcx8yQ7VRGpXh5LZKzpYQU9JTOY77QcXN9w6BhnvXphV1SPUIz0wxvYyAA2XXgpTYjVLPqlw729I29TWKY7WbK/yHBkpMZESWO9YrWnzlxxgXCUinnU1fFzuQr+mT0QSCAgemGHCZjLmIqoYeRb7vnoc3tRWVtiL6fjkzMIcP3Wp4PAALBnIFrJ9G/9WBQNlLnFciBBm7ll0GjCjT8KTBvTHofDuatdlfef2iAaphDjj8BMovt5DUDBn2Q4MicnWgxVfI0rq5VVifoPBu34GSv2FdJWRHr7hBEvxsGdxWyWsLXecZIuImdl82w/pgAbg1l73r+uoY7RjmGuHi2rZVBKvd1nEe/D92OCnlIX1X3X4NntNc0Nn1ujNbr1rtF5bZOKF7jvBjBz6vNUpuCyJCt7v0+3w1V83tws5riMXZZRiGwhLoPMVYQG9PENI/CiTO6ZEapEr0Q/M7DnS8KD6K7wEI+gZi3OkK0G+wDr01uTb4AglP9pzvsv3Ex0lQ==";
                var 
    passphrase "2a03f1c954abfd1e06acc4b97b19dbba";
                var 
    protection = new Protection();
                var 
    decrypted protection.OpenSslDecrypt(encryptedTextpassphrase);
                
    Console.WriteLine(decrypted);
            }

        }

        public class 
    Protection
        
    {
            public 
    string OpenSslDecrypt(string encryptedstring passphrase)
            {
                var 
    encryptedBytesWithSalt Convert.FromBase64String(encrypted);
                var 
    salt = new byte[8];
                var 
    encryptedBytes = new byte[encryptedBytesWithSalt.Length salt.Length 8];
                
    Buffer.BlockCopy(encryptedBytesWithSalt8salt0salt.Length);
                
    Buffer.BlockCopy(encryptedBytesWithSaltsalt.Length 8encryptedBytes0encryptedBytes.Length);
                
    DeriveKeyAndIv(passphrasesaltout var keyout var iv);
                return 
    DecryptStringFromBytesAes(encryptedByteskeyiv);
            }
            private 
    void DeriveKeyAndIv(string passphrasebyte[] saltout byte[] keyout byte[] iv)
            {
                var 
    concatenatedHashes = new List<byte>(48);

                var 
    password Encoding.UTF8.GetBytes(passphrase);
                var 
    currentHash = new byte[0];
                var 
    md5 MD5.Create();
                var 
    enoughBytesForKey false;
                while (!
    enoughBytesForKey)
                {
                    var 
    preHashLength currentHash.Length password.Length salt.Length;
                    var 
    preHash = new byte[preHashLength];

                    
    Buffer.BlockCopy(currentHash0preHash0currentHash.Length);
                    
    Buffer.BlockCopy(password0preHashcurrentHash.Lengthpassword.Length);
                    
    Buffer.BlockCopy(salt0preHashcurrentHash.Length password.Lengthsalt.Length);

                    
    currentHash md5.ComputeHash(preHash);
                    
    concatenatedHashes.AddRange(currentHash);

                    if (
    concatenatedHashes.Count >= 48)
                        
    enoughBytesForKey true;
                }

                
    key = new byte[32];
                
    iv = new byte[16];
                
    concatenatedHashes.CopyTo(0key032);
                
    concatenatedHashes.CopyTo(32iv016);
            }
            
    string DecryptStringFromBytesAes(byte[] cipherTextbyte[] keybyte[] iv)
            {
                var 
    aesAlg = new RijndaelManaged Mode CipherMode.CBCKeySize 256BlockSize 128Key keyIV iv };
                var 
    decryptor aesAlg.CreateDecryptor(aesAlg.KeyaesAlg.IV);
                
    using var msDecrypt = new MemoryStream(cipherText);
                
    using var csDecrypt = new CryptoStream(msDecryptdecryptorCryptoStreamMode.Read);
                
    using var srDecrypt = new StreamReader(csDecrypt);
                var 
    plaintext srDecrypt.ReadToEnd();
                return 
    plaintext;
            }
        }
    }
    Không dùng thêm lib, code lấy trên mạng em về chế cháo lại thêm để cho gọn nhẹ xử lý đúng case đè bài cho :D
     
    wpresources, Nai, dev9x and 5 others like this.
  4. Hoa Mãn Lâu

    Hoa Mãn Lâu Trưởng Môn

    Ôi vờ lờ, e mò cả 2 ngày ko ra, pác code cái ra luôn. How to dc pro như pác đây ạ. Hizhiz {beat_shot}
    --- Double Post Merged, Jun 27, 2021, Original Post Date: Jun 27, 2021 ---
    Thanks a nhiều, để e thử. @Newbie88 bữa pác hỏi nè.
     
    Newbie88 and firefox like this.
  5. Phan Thị

    Phan Thị Bang Chúng

    Newbie88 likes this.
  6. Newbie88

    Newbie88 Tân Thủ Thôn

    Các bro nhiệt tình quá, e cảm ơn nhiều ạ, thả tim <3 <3