
算法
17bdw学编程
这个作者很懒,什么都没留下…
展开
-
Gh0st配置加密与解密算法(异或、Base64)
1、前言分析木马程序常常遇到很多配置信息被加密的情况,虽然现在都不直接分析而是通过Wireshark之类的直接读记录。2017年Gh0st样本大量新增,通过对木马源码的分析还发现有利用Gh0st加密方式来传播的源码中的后门。2、加密思路控制端:对字符串异或、移位、Base64编码服务端:对字符串Base64解码、移位、异或3、实践代码加密编码// Base64编码static char base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef原创 2020-05-10 01:22:13 · 494 阅读 · 0 评论 -
RSA算法过程-求解密钥
1、密钥的计算获取过程密钥的计算过程为:首先选择两个质数p和q,令n=p*q。令k=ϕ(n)=(p−1)(q−1),原理见2的分析选择任意整数d,保证其与k互质取整数e,使得[de]k=[1]k。也就是说de=kt+1,t为某一整数。2、RSA加密算法原理解析下面分析其内在的数学原理,说到RSA加密算法就不得不说到欧拉定理。 欧拉定理(Euler’s theorem)是欧拉在证明费马小定理的过程中,发现的一个适用性更广的定理。 首先定义一个函数,叫做欧拉Phi函数,即ϕ(n),其原创 2020-05-10 01:20:42 · 3950 阅读 · 0 评论 -
leetcode-easy-java 1、7
1. 两数之和https://leetcode-cn.com/problems/two-sum/comments/HashMapHash_Map.containsKey(key_element)参数:该方法只接受一个参数key_element,该参数引用应在map内检查其映射的键。返回值:如果检测到密钥的存在,则该方法返回布尔值true,否则返回false。put写入ge...原创 2020-01-17 22:25:27 · 120 阅读 · 0 评论 -
Base64编码懂起来
1、说明Base64是网络上最常见的用于传输8Bit字节码的编码方式之一,Base64就是一种基于64个可打印字符来表示二进制数据的方法。2、编码ASCII码 -> 十六进制码 -> 二进制 -> 每两个字为一组,分为三组 -> 转换的数字就是密钥表中的索引值,通过索引值到密钥表中找对应的字母生成编码后的字符串。如果字符串中满足3个字节的需求前面加00,如果遇到转...原创 2019-12-13 18:45:17 · 106 阅读 · 0 评论 -
wchar、char格式化符输出、CString转String、String转CString、Cpp读文件
1、C语言题目题目内容:求斐波那契Fibonacci数列 求函数f(n) = 0 n = 0 = 1 n = 1 = f(n-1) + f(n-2) n > 12、代码实现...原创 2019-12-06 13:22:19 · 480 阅读 · 0 评论 -
[C++]解决vs2015经常卡顿的办法
Algorithm【leetcode】804. Unique Morse Code Wordshttps://leetcode.com/problems/unique-morse-code-words/1)problemInternational Morse Code defines a standard encoding where each letter is mapped to a ...原创 2019-12-06 16:58:33 · 1170 阅读 · 0 评论 -
[c++]平均成绩、从尾到头打印链表、整数从大到小排序、二分法查找、斐波那契数列
Algorithm【leetcode】Reverse Stringhttps://leetcode.com/problems/reverse-string/1)problem编写一个以字符串作为输入并逆转字符串的函数。2)answer字符串大于0,就从最末尾开始取值。3)solution#include "pch.h"#include <stdio.h>#inclu...原创 2019-12-06 17:00:32 · 924 阅读 · 0 评论 -
用C++获取URL中的主机域名
Algorithm【leetcode】125验证回文串https://leetcode.com/problems/valid-palindrome/1)problem给定一个字符串,验证它是否是回文串,只考虑字母和数字字符,可以忽略字母的大小写。说明:本题中,我们将空字符串定义为有效的回文串。示例 1:输入: "A man, a plan, a canal: Panama"输...原创 2019-12-06 17:01:46 · 471 阅读 · 0 评论 -
[C++]结构体、联合体大小计算
AlgorithmSingle Numberhttps://leetcode.com/problems/single-number/1)problemGiven a non-empty array of integers, every element appears twice except for one. Find that single one.Note:Your algor...原创 2019-12-06 16:57:34 · 190 阅读 · 0 评论 -
[C++]cmdline—一个轻量级的C++命令行解析库
Algorithmto-lower-casehttps://leetcode.com/problems/to-lower-case/1)problemImplement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.Example 1: ...原创 2019-12-06 16:56:00 · 1179 阅读 · 0 评论 -
Huffman编码(数据结构+算法)
Algorithm做一个 leetcode 的算法题Unique Email Addresseshttps://leetcode.com/problems/unique-email-addresses/1)problem929. Unique Email AddressesEvery email consists of a local name and a domain name, ...原创 2019-12-06 16:45:21 · 338 阅读 · 1 评论 -
leetcode 125、136、344、557、657、709、771、804、893、929
Algorithm做一个 leetcode 的算法题771. Jewels and Stones1)problemhttps://leetcode.com/problems/jewels-and-stones/ou’re given strings J representing the types of stones that are jewels, and S representing...原创 2019-12-06 13:25:46 · 991 阅读 · 0 评论