分类 perl/php/python/gawk/sed articles

golang实现RSA和AES加解密

密码学里目前有两大经典算法,一个是对称加解密,其代表是AES加解密;另一个是非对加解密,其代表是RSA加解密。这里就以这两个经典算法为例,简单列下其在golang里实现的代码。 一、AES加解密 AES加密又分为ECB、CBC、CFB、OFB等几种,这里只列两种吧。 1、CBC加解密 1/*……

Continue reading

AES加密的几种工作模式

高级加密标准(Advanced Encryption Standard: AES)是美国国家标准与技术研究院(NIST)在2001年建立了电子数据的加密规范。其是对称加解密算法的最经典算法之一,它是一种分组加密标准,每个加密块大小为128位,允许的密钥长度为128、192和256位。这里只介绍ECB、CBC、CFB和O……

Continue reading

golang指针

什么是指针,指针是存储一个变量的内存地址的变量。在下图,变量 b 的值是 156,存储在地址为 0xc0000100a8的内存中。变量 a 存储了变量 b 的地址。现在可以说 a 指向 b。 golang-point 一、指针的声明 指向类型 T 的指针用 *T 表示。先看一个测试代碱: 1package main 2import ( 3 "fmt" 4) 5func main() { 6 b := 255 7 var a *int = &b 8 fmt.Printf("Type of a is %T\n",……

Continue reading

golang数组

一、数组及声明 数组不难理解,就是array类型的数据,Go不允许在数组中混合使用不同类型的元素(比如整数和字符串)。所以数组是类型相同的元素的集合。例如,整数 5, 8, 9, 79, 76 的集合就构成了一个数组。var a [3]int 这里就命名了一个名称为a,里面包含三个值的整型数组。所以我们总结为:数组的类型……

Continue reading

golang中struct、json、map的转化

一、Json和struct转换 1、json转化为struct结构体 json里面的key和struct里面的key要一致,struct中的key的首字母必须大写,而json中大小写都可以。如果json中使用的是小写,如何与struct中的保持一致呢?这里就可以使用tag在结构体定义……

Continue reading

Java中Socket Read阻塞问题

本人来说并不熟悉JAVA语言,只是近期在分析某个简单的java agent程序时,根据对应的代码写了一个对接的程序,两者之间是典型的C/S socket编程。客户端在向服务端发送相应的指令后,服务端(装agent的主机)执行后会返回执行的数据给客户端。在直接一行行收取数据时是正常的,……

Continue reading

golang之map字典

map 是一种无序的键值对的集合。map 最重要的一点是通过 key 来快速检索数据,key 类似于索引,指向数据的值。map 是无序的,我们无法决定它的返回顺序,这是因为 map 是使用 hash 表来实现的。map 的 hash 表包含了一个桶集合(collection of buckets)。当我们存储,移除或者查找键值对(ke……

Continue reading

golang结构体的使用

结构体(struct)是用户自定义的类型,它代表若干字段的集合。有些时候将多个数据看做一个整体要比单独使用这些数据更有意义,这种情况下就适合使用结构体。比如将一个员工的 firstName, lastName 和 age 三个属性打包在一起成为一个 employee 结构就是很有意义的。其使用需要遵循以下要求: 使用type struct{} 定义结构,名称遵循……

Continue reading

反编译java class文件

在上一篇《java module解压及java常见打包格式》一文中,我们解包出了class文件,因为class文件是经过java编译过的。是无法直接进行查看的,不过这难不道老司机,打开 jd-gui 工具直接查看源码就行了,不过显然问题想的有点简单了,在jd-gui查看时,发现只有个别class……

Continue reading

Latest articles

Categories

Tags

ACL AD AES AI AWS Ansible Atlassian Azure BMC Blockchain Brocade CDH5 CL210 Cobbler Confd C语言 DDOS DISTINCT DNS Duckdb EKS ELK GCP Ghost Git Glusterfs Go Godaddy Grafana HBA HCIE Hotspot HttpWatch IBM IIS IOS InfluxDB Ingress InnoDB JavaScript Jinja2 KVM Keepalived Mplayer MySQLdb Netlify OpenResty PM PostgreSQL QoS RH318 RH442 RHCA RHCE RHEV RSA SRE SecureCRT Statuscode SublimeText2 TC Telecom Tencentcloud VBA aira2 alpine android anpic apache apm apparmor appfog apr apt-get aria2 array atop audit awk awstats axel backdoor backup bamboo bash bat benchmark bigdata bin bind bitwise book bootstrap bsd c1000 cache capistrano catlog centos centos7 chatops chattr check_mk checkinstall cisco clearall clickhouse cloud-desktop cmdb cms collectd comm compress conver corosync cpu crontab crunchbang css curl date decode dell desktop devops df dhcp diff diskpart django docker dos2unix dpkg drupal etcd excel fail2ban fastcgi fdisk fiddler find firewalld flask flvtool ftp function fuser geek gin github gitlab glances golang google gooupadd graphviz gravatra grep grub2 hadoop haproxy hardware heartbeat helm hexdump hhvm history html http/html/web httplogs https huawei huaweicloud hugo icmp iconv ifconfig inotify iopp ipmitool iptables iredmail iscsi isito it-news java jdk jenkins jira join joomla k3s k8s kdump kernel kingate lamp last leetcode lib light-http linux linux高级篇 ln ls lsi lsof lvm lvs mac mail man mark markdown matplotlib maven memcached microservice mimikatz mkdocs mkpasswd mmonit mod_jk mongodb monit monitor mono moodle mosh mount mpm mrtg mtr my.cnf mysql mysqlbinlog mysqld_multi mysqldump mysqlhotcopy nagios nc nethogs nexus nfs nginx nmon nocatlog node.js nrpe ntfs ntop ntp obs ocr open-falcon openbox opencv openldap openssl openstack oracle oswatch paas pacemaker pam pandas parted pcp pcre pdf percona perl pexpect pgrep php php-fpm ping plsql develope postfix powershell prettify proc prometheus puppeteer pushd pwgen pxe pyecharts python python模块 radmin raid rdesktop read redhat redis redmine regex rh134 rhel7 rhel8 rm rman rootkit route rpm rpmforge rrdtool rsync rsyslog safe saltstack samba scapy screen sed selenium selinux seo seq session set shc sheepdog shell shopt sitemap skydns smokeping snffier snmp socket soft sort spider sql sqlserver squid ss ssh sshpass strace strings su sudo suse svn sysbench syslog-ng sysstat systemd t tar tcpcopy tcpdump tech telnet tengine test testlink threads time tmux tomcat touch tr tsar twisted ubuntu udev ulimit unix unixbench user-agent useradd varnish vbs vercel vi vim visudo vmstat vmware vnc voice vpn vscode vsftp vsftpd vue watchdog web webcam webistrano wget wiki windows wol wordpress workshop wsl x-windows xampp xcache xmllint xtrabackup yule yum zabbix zeromq zip zonetime zookeeper 下载工具 云主机 云原生 代理 加密 古意 吐槽 圈里圈外 娱乐 字符串函数 安全 平台架构 意林 推理 提权 故事汇 故障案例 数据结构 每日看点 民国史 生活 科学记录 站长管理工具 算法 管理 网站架构 翻墙 股票 行业 诗韵 负载均衡 远程管理 面试题

Links

Meta