书旗app字符串加密分析

28 篇文章 904 订阅 ¥99.90 ¥99.00
27 篇文章 201 订阅

本文案例是对书旗app搜索接口的请求密文进行逆向分析。

案例环境:书旗app (安卓11.5.4.152)、Frida、夜神、Jadx



抓包分析接口

在这里插入图片描述

‘https://ocean.shuqireader.com/sqan/render/render/search/native?_reqid=1ce4c18035’

在这里插入图片描述

脱壳反编译

查壳
在这里插入图片描述

脱壳
在这里插入图片描述

在这里插入图片描述

可以把非常小的删除掉,把非常大的单独拿出来分析一下。我先把最大的文件(47MB)单独用Jadx打开。


data定位

  • 4
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
为了保护应用程序中敏感的信息,比如数据库连接字符串,可以对其进行加密处理。下面是一个示例代码,可以实现在app.config文件中的数据库连接字符串加密: 1. 创建一个控制台应用程序,然后在程序中使用以下代码: ``` using System; using System.Configuration; using System.Security.Cryptography; using System.Text; namespace ConsoleApp1 { class Program { static void Main(string[] args) { // 获取app.config中的数据库连接字符串 string connectionString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString; // 加密字符串 string encryptedString = EncryptString(connectionString); // 将加密后的字符串写入app.config文件 Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings["MyConnectionString"].Value = encryptedString; config.Save(); Console.WriteLine("String has been encrypted!"); } // 加密字符串 private static string EncryptString(string inputString) { byte[] key = { 1, 2, 3, 4, 5, 6, 7, 8 }; byte[] iv = { 1, 2, 3, 4, 5, 6, 7, 8 }; byte[] inputBytes = Encoding.UTF8.GetBytes(inputString); using (DESCryptoServiceProvider des = new DESCryptoServiceProvider()) { byte[] outputBytes = null; // 创建加密器对象 using (ICryptoTransform encryptor = des.CreateEncryptor(key, iv)) { // 执行加密操作 outputBytes = encryptor.TransformFinalBlock(inputBytes, 0, inputBytes.Length); } // 将加密后的字节数组转成字符串 return Convert.ToBase64String(outputBytes); } } } } ``` 2. 在app.config文件中,添加以下内容: ``` <connectionStrings> <add name="MyConnectionString" connectionString="Data Source=(local);Initial Catalog=MyDatabase;User ID=myUsername;Password=myPassword" /> </connectionStrings> ``` 3. 运行程序,程序将会读取app.config文件中的数据库连接字符串,并将其加密后写入app.config文件中。加密后的连接字符串将会是一长串随机字符。 4. 在应用程序中,可以使用以下代码来获取解密后的数据库连接字符串: ``` string encryptedString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString; string decryptedString = DecryptString(encryptedString); ``` 其中,DecryptString方法的实现如下: ``` // 解密字符串 private static string DecryptString(string encryptedString) { byte[] key = { 1, 2, 3, 4, 5, 6, 7, 8 }; byte[] iv = { 1, 2, 3, 4, 5, 6, 7, 8 }; byte[] inputBytes = Convert.FromBase64String(encryptedString); using (DESCryptoServiceProvider des = new DESCryptoServiceProvider()) { byte[] outputBytes = null; // 创建解密器对象 using (ICryptoTransform decryptor = des.CreateDecryptor(key, iv)) { // 执行解密操作 outputBytes = decryptor.TransformFinalBlock(inputBytes, 0, inputBytes.Length); } // 将解密后的字节数组转成字符串 return Encoding.UTF8.GetString(outputBytes); } } ``` 这样,应用程序就可以安全地使用app.config文件中的数据库连接字符串了。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

考古学家lx(李玺)

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值