自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(51)
  • 收藏
  • 关注

原创 9-1. PHP创建图像步骤

php不仅可以处理文本数据,还可以创建不同的动态图像,比如GIF等注:在php中可以通过GD扩展库实现对图像的处理,不仅可以创建图像而且可以处理已有图像创建图像 绘制图像 生成图像 释放资源 图形验证码 水印 缩放与裁剪在php中通过GD库处理图像的操作都是在内存中处理,操作完成以后再以文件流的方式输出到浏览器或保存在服务器的磁盘中创建图像的4个步骤创建图像...

2018-12-31 16:37:48 771

原创 8-1. PHP日期与时间常用函数

设置时区默认的时区是UTC!data_default_timezone_set('Asia/Shanghai');获取当前Unix时间戳从Unix纪元(格林威治时间1970年1月1日0时0分0秒)开始到当前的秒数,time( );获取指定时间的Unix时间戳mktime( );如:mktime(0,0,0,10,1,2014);代表返回到2014年10月1日0时...

2018-12-31 13:49:37 268

原创 7-1. PHP正则表达式、元字符

正则表达式:描述了一些字符串的特征,然后通过这个特征可以配合一些特定的函数来完成对字符串更加复杂的一系列操作,是由普通字符串和特殊字符串组成的一个字符串普通字符(比如a到z)元字符(有特殊功能的字符,比如 *, +,?...)例如: '/a/', a就是普通字符,/是界定符(表示正则表达式的开始或结束)如:$pattern='/test/';$s...

2018-12-30 16:01:52 140

原创 6-1. PHP字符串处理常用函数

先看看处理字符串的常用函数去除空格或其他字符函数1. trim()//去除空格$str=' abc ';var_dump($str);var_dump(trim($str));//去除字符$str="abdskwbdwcw";var_dump($str);var_dump(trim($str,'asw'));//ltrim();去除左边//rtrim...

2018-12-30 14:52:01 257

原创 5-3. PHP预定义超全局数组、处理数组的相关函数

预定义超全局数组变量:已经定义好了的变量(存放的数据类型是数组)超全局:超级全局变量,作用域(有效区域)传递数据(提交数据)给服务器端主要有两种方式:get方式比如,?参数名=参数值&参数名=参数值.....http://localhost/test/index.php?参数名=参数值在服务器端(请求的php文件这边)可以通过$_GET来获取$_GET索引...

2018-12-29 22:31:00 172

原创 C语言主函数结构分析

int main( void )Every program in C begins executing at the function mainThe keyword int  indicates that main “returns” an integer valueThe void  Means that main does not receive any informatio...

2018-12-29 19:46:03 897

原创 C 几个数的最值并求平均数问题

问题:Write a program that reads integers repeatedly and terminates when it reads 0The program should display below informationThe range of input numbers  The average of input numbers (with 2 digi...

2018-12-29 19:17:13 441

原创 C 判断一个数里有几个相同的数字问题

问题:Write a program that reads an integer, and determines and prints how many digits in the integer are 7s#include<stdio.h>#include<stdlib.h>int num;int a, b, c, d, e;int i = 0;...

2018-12-29 18:13:29 3477

原创 C 求一个数的阶乘问题

问题Write a program that reads a nonnegative integer, and computes and prints its factorial(For example, 5! = 5x4x3x2x1 = 120)#include<stdio.h>#include<stdlib.h>int main(void) {...

2018-12-29 17:02:25 239

原创 C 求两个整数之间所有整数和问题

问题:Write a program that(1) inputs two integers (integer1 and integer 2)(2) prints sum of all integers between integer1 and integer2(3) Use while() statementEx) input : 10, 15 -> Sum : 10 ...

2018-12-29 16:19:48 4342

原创 C 判断两个数是否为倍数关系问题

问题:Write a program that reads two integers, and determines and prints if the first is a multiple of the second#include<stdio.h>#include<stdlib.h>int main(void) { int num1, num...

2018-12-29 15:51:44 4785

原创 Visual Studio 2017 怎么从a Windows App设置成 a Console App

 为什么要转换设置?简单来说Windows Application的主函数是WinMain,而Windows Console Application的主函数是main 

2018-12-25 22:59:41 1399

原创 C 拆分各个位上的数字,并抽取任意位上数计算问题

问题:Write a program :Inputs one five-digit number, separates the number into its individual digits1. Prints the digits separated from one another by three spaces each2. Prints the addition (and...

2018-12-25 22:39:53 1216 1

原创 C 平方、三次方输出问题

问题:write a program that calculates the squares and cubes of the numbers from 0 to 10 and uses tabs to print the following table of values:#include<stdio.h>#include<stdlib.h>int m...

2018-12-25 21:56:32 700

原创 C 求最大值和最小值问题

问题:Write a program that reads in five integersand then determines and prints the largest and the smallest integers in the group.#include<stdio.h>#include<stdlib.h>int main(void...

2018-12-25 21:43:09 4970

原创 JS中的各种引用类型总结(Object引用类型、function引用类型、array引用类型)

JS中的对象是根据某种引用类型创建出来的实例!常用的引用类型:Object引用类型//方法 1var obj1=new Object(); //Object开头必须大写obj1.name="ROBIN.FANG";obj1.sex="true"; obj1.age=23;alert(obj1.name);alert(obj1.age);//方法 2var obj2=...

2018-12-25 20:50:56 395

原创 5-1. PHP数组创建、数组遍历

数组分类索引数组:索引值为整数的数组 关联数组:索引值为字符串的数组,使用字符串作为索引,这使得编程更加人性化,这在其他编程中非常少见,但是在php中会被大量使用在开发过程中,使用起来极其方便名字如果取的是整形:那么这个数组就是索引数组名字如果是字符串类型:那么这个数组就是关联数组比如:0 name "李广"1 ...

2018-12-23 21:05:14 889

原创 4-1. PHP自定义函数、变量范围

任何有效的php代码都可以作为函数体使用//例子1function add($a,$b){ echo $a+$b;}add(10,20); //php页面显示30// 例子2function add($a,$b){ return $a+$b; //return功能: 返回值给调用的地方,结束这个函数的运行}add(10,20); //php页面什...

2018-12-23 17:40:58 368

原创 NP完全问题 Non-deterministic Polynomial 多项式复杂程度的非确定问题

1.definitions for NP (using the handout titled "np-wiwki")- verifier, proof, certificate, (short/succinct), language, decision problem在讲P类问题之前先介绍两个个概念:多项式,时间复杂度。1、多项式:axn-bxn-1+c 叫x最高次为n...

2018-12-21 00:43:23 3953

原创 公钥密码学_数字签名和消息认证的区别

在公钥密码学不足的问题在于怎么让接收方确定消息的发送者是谁,以及发送的消息是否被攻击者篡改过,解决这两个问题就可以让公钥加密变得完善 消息认证消息认证就是确定接收者接收到的消息是否真实,例如有没有被改动过啊,消息认证又叫完整性校验,在我们通信OSI安全模型中称作封装,消息认证具体可以认证哪些信息呢?包括信息源(就是谁发的)、内容的真假、时间等。消息认证只在通信的双方进行,而不允许第三...

2018-12-18 20:11:20 5922

原创 密码学_Elgamal密码体制 2

公钥加密中加密和解密算法是一样的,但加密和解密使用不同秘钥,发送方拥有加密或解密秘钥,而接收方拥有另一秘钥,在对称加密中加密和解密使用相同的秘钥和相同的算法,公钥密码学仅限用在秘钥管理和签名这类应用中根据上图,Alice 生成公开和保密的秘钥对,Bob用Alice的公钥加密,然后Alicce用自己的私钥解密 ElGamal是一种常见的加密算法,是在公钥密码体制和椭圆曲线加密体制...

2018-12-18 20:10:35 715

原创 Diffie-Hellman Key Exchange(a part of ElGamal)

除了RSA之外 ,Other Public-key cryptosystems are :ElGamal cryptographic(Diffie-Hellman key exchange) Elliptic curve cryptography(Elliptic curve arithmetic)还有Pseudorandom number generation based on an a...

2018-12-18 20:09:55 302

原创 密码学Hash函数

1. 安全Hash函数具有哪些特征?对于大的输入集合使用该函数,产生的输出结果均匀地分布且看起来随机 2.抗弱碰撞和抗强碰撞之间的区别是什么?  3.Hash函数中的压缩函数的作用是什么?  4.高位在前格式和低位在前格式的区别是什么?  5.SHA中使用的基本算术和逻辑函数是什么?  6.描述NIST评估SHA-3候选算法的一系列标准...

2018-12-18 20:09:43 1025 1

原创 ElGamal Cryptography(公钥密码学代表之一)

ElGamal CrypotographyEach user generates his key:-Choose a secret key :  1<XA<q-1-Compute their public key: {q,a,YA=a^XA mod q} ElGamal Message ExchangeB encrypts and sends message t...

2018-12-18 20:09:34 266

原创 ElGamal、Schnorr digital signature scheme

• ElGamal digital signature scheme • Schnorr digital signature scheme • Digital signature standard (DSS) Message authentication- Protects two parties who exchange messages from third party...

2018-12-18 20:09:23 566

原创 公钥密码学 RSA算法 实战

ProblemTest all odd numbers in the range from 233 to 241 for primality using the Miller-Rabin test with base 2. Encrypt the message M=2 using RSA with the following parameters. n=56153,e=23 Comput...

2018-12-18 13:35:11 662

原创 Public-key Cryptography RSA

Asymmetric since parties are not equal.  RSA只是公钥密码学的重要组成部分,还需要消息认证和数字签名一起组成,也就是RSA没法完全独立出来,他们必须一起构成公钥密码学Why use Public-key cryptography??Key distribution - how to have secure communications in...

2018-12-15 17:40:10 1101

原创 CRT、Primitive roots、Discrete Logarithms

The Chinese Remainder TheoremUsed to speed up modulo computations!!! If working modulo a product of numbers: mod M=m1*m2*m3*....*mkCRT let us work in each moduli mi separately. To compute ...

2018-12-15 14:40:10 154

原创 Primality Testing、Miller Rabin Algorithm

Primality TestingDetermine whether a given large number is prime, traditionally sieve using trial division. Two properties of prime numbers:property 1if p is prime and a is a positive integer...

2018-12-15 11:21:09 387

原创 Fermat Theorem and Euler Theorem

Fermat Theorema^(p-1) = 1 mod p , where p is prime and gcd(a, p)=1Also known as Fermat's litte Theorem Useful in public key and primality testing Alternative form of Fermat's theorm:a^p = ...

2018-12-14 19:26:45 281

原创 数论入门 素数

掌握的知识点:Prime Numbers Fermat's and Euler's Theorems  Testing for Primality The Chinese Remainder Theorem Discrete Logarithms  Prime NumbersPrime numbers only have divisors of 1 and selfcan...

2018-12-14 16:46:25 192

原创 密码学 数论入门 Euler Theorem 实战

利用欧拉定理找一个0~9之间的数a,使得7^1000模10与a同余(注意这等于7^1000的十进制展开的最后一位)Euler' sTheorem:for every (a,n) that are relatively prime to Ø(n) is a conginent model.a ^Ø(n) =1 mod nThis condition, a is between 0 to...

2018-12-14 15:46:40 2489 1

原创 中国剩余定理 CRT

CRT:某一范围整数可以通过它的一组剩余类数来重构,这组剩余类数是对该整数用一组两两互素的整数取模得到。功能:使得模M的大数运算转化到更小的数上来进行运算,当M为150位或150位以上时,这种方法非常有效,但我们需要事先分解M 上面说的有点悬乎,那我们举个例子看看:Z10(0,1,2,3....9)中的10个整数可通过它们对2和5(10的两个因子)取模所得的两个余数来重构。假设已知...

2018-12-14 01:20:51 436

原创 密码学 数论入门 Fermat Theorem 实战

对两个连续整数n和n+1,为什么gcd(n,n+1)=1?Because when n+1 is divided by n then remainder is 1. Therefore 1 is  the GCD of n, n+1 利用费马定理计算3^201 mod 11Fermat theorem explains a^p-1 =1 mod p, where p is a prim...

2018-12-14 01:15:58 3359

原创 数论入门 思考

什么是素数?integer P>1 is primer only when it has the factor +1、-1、+p、-p表达式a整除b的意义是什么?如果a|b,那么对任意的p属于P有 ap<=bp什么是欧拉函数?指小于n且与n互素的正整数个数Miller-Rabin测试可确定一个数不是素数,但不能确定一个数是素数,该算法如何用来进行素性测试?TEST...

2018-12-13 22:40:55 310

原创 扩展的欧几里得算法 Extended Euclidean algorithm

对于给定的a和b,扩展的欧几里得算法不仅计算出最大公因子d,而且还有另外两个整数 x和y,满足方程:ax+by=d = gcd(a,b) , 显然a和b具有相反的正负号。几个例子: a=42, b=30时,这个方程结果如下表看上面一个表我们发现所有的结果都是6的倍数,原因是 42x+30y=6(7x+5y),所以结果都是6的倍数那么我们得出一个结论:...

2018-12-13 16:25:55 707

原创 密码学Hash函数 Cryptographic Hash Functions #11

需要掌握的内容如下:Two simple hash functions Hash functions based on cipher block chaining  SHA(Secure hash algorithms) Condenses压缩 arbitrary message to fixed size:   h=H(M) Good hash function 特征E...

2018-12-13 14:19:28 934

原创 公钥密码学 Miller-Rabin算法(素性测试)

ProblemTest all odd numbers in the range from 233 to 241 for primality using the Miller-Rabin test with base 2. Answer:test  n=233233-1=2^3 * 29, thus k=3, q=29 a^q mod n=2^29 mod 233=1 te...

2018-12-12 16:46:58 824

原创 公钥密码学 RSA算法

整个RSA过程大体是 生成秘钥、加密、解密3个步骤 第一步 生成秘钥选两个素数 p,q 保密,然后计算 n=pq 公开,                    在1<e<Ø(n)范围内选择一个数e作为公钥,e要与Ø(n)互素就行,即gcd(Ø(n),e)=1求出私钥 d≡e^-1 mod Ø(n)       所以 公钥PU={e,n}, 私钥 PR={d,...

2018-12-12 14:16:43 2090

原创 数字签名方案 汇总

消息认证:一个短的字符V追加到消息M之后,用以认证该消息发送方:M---->M||V接收方:M||V---->yes/no (认证) 一个安全的认证系统,要满足:接受者能够检验消息的合法性、真实性、完整性 消息的发送方和接收方不能抵赖 除了合法的消息发送者,其他人不能伪造合法的消息 认证函数----->认证协议 可以用来做认证的函数分为三类:...

2018-12-10 13:33:52 2016 2

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除