• 大小: 1.95M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-20
  • 语言: C#
  • 标签: 其他  

资源简介

C#爬取音乐源码.zip

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;

namespace UnLockMusic
{
    /// 
    /// 来自于网络:
    /// 

    class clsAESEncrypt
    {
        public clsAESEncrypt()
        {

        }

        /// 
        /// AES加密 
        /// 

        /// 明文
        /// 密钥
        /// 向量
        /// 
        public string AESEncrypt(string text string password string iv)
        {
            RijndaelManaged rijndaelManaged = new RijndaelManaged();
            rijndaelManaged.Mode = CipherMode.CBC;
            rijndaelManaged.Padding = PaddingMode.PKCS7;
            rijndaelManaged.KeySize = 128;
            rijndaelManaged.BlockSize = 128;

            byte[] pwdBytes = System.Text.Encoding.UTF8.GetBytes(password);
            byte[] keyBytes = new byte[16];
            int len = pwdBytes.Length;
            if (len > keyBytes.Length)
            {
                len = keyBytes.Length;
            }
            System.Array.Copy(pwdBytes keyBytes len);
            rijndaelManaged.Key = keyBytes;

            byte[] ivBytes = System.Text.Encoding.UTF8.GetBytes(iv);
            rijndaelManaged.IV = ivBytes;

            ICryptoTransform iCryptoTransform = rijndaelManaged.CreateEncryptor();
            byte[] textBytes = Encoding.UTF8.GetBytes(text);
            byte[] targetBytes = iCryptoTransform.TransformFinalBlock(textBytes 0 textBytes.Length);
            return Convert.Tobase64String(targetBytes);

        }
        /// 
        /// AES解密
        /// 

        /// 密文
        /// 密钥
        /// 向量
        /// 
        public string AESDecrypt(string text string password string iv)
        {
            RijndaelManaged rijndaelManaged = new RijndaelManaged();
            rijndaelManaged.Mode = CipherMode.CBC;
            rijndaelManaged.Padding = PaddingMode.PKCS7;
            rijndaelManaged.KeySize = 128;
            rijndaelManaged.BlockSize = 128;

            byte[] encryptedData = Convert.Frombase64String(text);
            byte[] pwdBytes = System.Text.Encoding.UTF8.GetBytes(password);
            byte[] keyBytes = new byte[16];
            int len = pwdBytes.Length;
            if (len > keyBytes.Length)
            {
                len = keyBytes.Length;
            }
            System.Array.Copy(pwdBytes keyBytes len);
            rijndaelManaged.Key = keyBytes;

            byte[] ivBytes = System.Text.Encoding.UTF8.GetBytes(iv);
            rijndaelManaged.IV = ivBytes;

            ICryptoTransform iCryptoTransform = rijndaelManaged.CreateDecryptor();
            byte[] targetBytes = iCryp

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-02-20 14:43  C#爬取音乐源码\
     目录           0  2020-02-15 22:39  C#爬取音乐源码\UnLockMusic\
     文件         187  2020-02-08 16:29  C#爬取音乐源码\UnLockMusic\App.config
     文件       24226  2020-02-15 22:39  C#爬取音乐源码\UnLockMusic\Form1.Designer.cs
     文件       25354  2020-02-15 22:39  C#爬取音乐源码\UnLockMusic\Form1.cs
     文件       11073  2020-02-15 22:39  C#爬取音乐源码\UnLockMusic\Form1.resx
     文件         525  2020-02-08 16:44  C#爬取音乐源码\UnLockMusic\Program.cs
     目录           0  2020-02-08 16:29  C#爬取音乐源码\UnLockMusic\Properties\
     文件        1346  2020-02-08 16:29  C#爬取音乐源码\UnLockMusic\Properties\AssemblyInfo.cs
     文件        2874  2020-02-08 16:29  C#爬取音乐源码\UnLockMusic\Properties\Resources.Designer.cs
     文件        5612  2020-02-08 16:29  C#爬取音乐源码\UnLockMusic\Properties\Resources.resx
     文件        1098  2020-02-08 16:29  C#爬取音乐源码\UnLockMusic\Properties\Settings.Designer.cs
     文件         249  2020-02-08 16:29  C#爬取音乐源码\UnLockMusic\Properties\Settings.settings
     文件        4875  2020-02-13 19:48  C#爬取音乐源码\UnLockMusic\UnLockMusic.csproj
     目录           0  2020-02-14 22:15  C#爬取音乐源码\UnLockMusic\bin\
     目录           0  2020-02-14 20:51  C#爬取音乐源码\UnLockMusic\bin\Debug\
     文件       53760  2020-02-11 22:09  C#爬取音乐源码\UnLockMusic\bin\Debug\AxInterop.WMPLib.dll
     文件      330752  2020-02-11 22:09  C#爬取音乐源码\UnLockMusic\bin\Debug\Interop.WMPLib.dll
     目录           0  2020-10-05 15:44  C#爬取音乐源码\UnLockMusic\bin\Debug\Music\
     文件      504320  2016-01-28 14:22  C#爬取音乐源码\UnLockMusic\bin\Debug\Newtonsoft.Json.dll
     文件       44032  2020-02-14 22:04  C#爬取音乐源码\UnLockMusic\bin\Debug\UnLockMusic.exe
     文件         187  2020-02-08 16:29  C#爬取音乐源码\UnLockMusic\bin\Debug\UnLockMusic.exe.config
     文件       67072  2020-02-14 22:04  C#爬取音乐源码\UnLockMusic\bin\Debug\UnLockMusic.pdb
     文件       24224  2020-02-14 22:12  C#爬取音乐源码\UnLockMusic\bin\Debug\UnLockMusic.vshost.exe
     文件         187  2020-02-08 16:29  C#爬取音乐源码\UnLockMusic\bin\Debug\UnLockMusic.vshost.exe.config
     文件         251  2020-02-13 20:32  C#爬取音乐源码\UnLockMusic\bin\Debug\config.txt
     文件        4744  2020-02-14 19:48  C#爬取音乐源码\UnLockMusic\bin\Debug\log.txt
     目录           0  2020-10-05 15:39  C#爬取音乐源码\UnLockMusic\bin\Release\
     文件       53760  2020-02-12 01:33  C#爬取音乐源码\UnLockMusic\bin\Release\AxInterop.WMPLib.dll
     文件      330752  2020-04-26 22:12  C#爬取音乐源码\UnLockMusic\bin\Release\Interop.WMPLib.dll
     目录           0  2020-10-05 15:44  C#爬取音乐源码\UnLockMusic\bin\Release\Music\
............此处省略75个文件信息

评论

共有 条评论