Experiment one, traditional cipher algorithm
I. Objectives and tasks of the experiment
By programming to realize the substitution cipher algorithm and the substitution cipher algorithm, deepen the understanding to the classical cipher system, lays the foundation for the Deep Study cryptography
Second, the experimental
RSA Algorithm Description:
1. p and q are not equal. They are two prime numbers that are large enough. P and q are confidential.
2. n = p * q n is public.
3, f (n) = (p-1) * (q-1)
4. e is the prime number of mutual quality with f (n ).
5. Calculated parameter d
6. After five steps above, the public key KU = (e, n) Private Key KR = (d, n) is obtained)
The following two articles clearly describe this:
Http://wenku.baidu.com/view/e53fbe36a32d7375a417801b.html
Http://bank.hexun.com/2009-06-24/11895
black border to the widget! ");}}7. Scroll bar DecoratorPackage Decorator;/**
Created by jiqing on 2016/10/14.*/public class Scrollbardecorator extends componentdecorator{Public Scrollbardecorator (Component Component) {Super (component); Calling the parent class constructor}
public void display () {This.setscrollbar ();Super.display ();}public void Setscrollbar () {SYSTEM.OUT.PRINTLN ("Add scroll bar for widget! ");}}8. Client CallsPackage Decorator; Decorator mode/**
Cr
Nodejs's crypto module public key encryption and decryptionNodejs has the following 4 classes related to public key cryptography.1. Cipher: Used for encrypting data;2. Decipher: Used to decrypt data;3. Sign: Used to generate signatures;4. Verify: Used to verify the signature;When using public key cryptography, public and private keys are used to create encrypted data that only the owner of the private key can read, and to authenticate the signature of
How to Prevent 1024-bit Diffie-Hellman from being cracked
On Wednesday, Researchers Alex Halderman and Nadia Heninger proposed that NSA has been able to decrypt a large number of HTTPS, SSH, and VPN connections by attacking a 1024-bit prime number Diffie-Hellman Key Exchange algorithm.
NSA may have cracked 1024-bit Diffie-Hellman
Logjam attacks discovered in the first half of this year allow a hacker using man-in-the-middle attacks to reduce the output level of the TLS link encryption algorithm
How to Prevent 1024-bit Diffie-Hellman from being cracked
On Wednesday, Researchers Alex Halderman and Nadia Heninger proposed that NSA has been able to decrypt a large number of HTTPS, SSH, and VPN connections by attacking a 1024-bit prime number Diffie-Hellman Key Exchange algorithm.
NSA may have cracked 1024-bit Diffie-Hellman
Logjam attacks discovered in the first half of this year allow a hacker using man-in-the-middle attacks to reduce the output level of the TLS link encryption algorithm
/* Des Java
Complied OK with eclipse
Create a desencrypt class, copy the following code, and compile it.
*/Import java. Security. Key;Import java. Security. securerandom;Import javax. crypto. cipher;Import javax. crypto. keygenerator;
Import sun. Misc. base64decoder;Import sun. Misc. base64encoder;
/**** Use des to encrypt and decrypt byte [] and string types.* The ciphertext can be stored using string, byte.** Method:* Void getkey (string strkey) gen
consistent with the background)
Paste the Code directly:
For IOS, You need to introduce GTMBase64.h, GTMBase64.m, and GTMDefines. h. I found this on github and I will search for it myself, as well as
# Import "ViewController. h "# import Java code: Introduce sun. misc. BASE64Decoder. jar by yourself.
Package com. yue; import java. io. IOException; import java. security. secureRandom; import javax. crypto. cipher; import javax. crypto. secretKey;
1. MD5 is not described here. For details, refer to subsequent articles.
2. DES data encryption:
Import java. io. UnsupportedEncodingException;
Import java. security. SecureRandom;
Import javax. crypto. Cipher;
Import javax. crypto. SecretKey;
Import javax. crypto. SecretKeyFactory;
Import javax. crypto. spec. DESKeySpec;
Public class test
{
Public static void main (String [] args)
Throws UnsupportedEncodingException
{
// Content to b
(This article only saves copies)
Original http://edu.yesky.com/edupxpt/64/2182064.shtml
In view of the importance of RSA encryption and the lack of relevant source code, it is hereby posted. Need to download the bcprov-jdk14-123.jar.
Import javax. crypto. cipher;
Import java. Security .*;
Import java. Security. spec. rsapublickeyspec;
Import java. Security. spec. rsw.vatekeyspec;
Import java. Security. spec. invalidkeyspecexception;
Import java
is twice the inner circle radius, so you only need to input a small r. Call a startPath () function in drawStar to draw a standard five-star path.
Standard Five-star path: Only one context is input, and a large circle radius of 1 is drawn at (0, 0) without any offset or any rotation of the five-star.
After the standard pentagram is drawn in drawStar, the displacement of the standard pentagram is changed to the position (x, y) Through graphical transformation. The size is changed to R, and the
Cl;H = 1; % index the first element in the PIX, that is, the heightW = 2; % index the second element in the PIX, that is, the width.Jiaodu = 45; % rotation angle, clockwiseImg1_imread('corner.png '); % here V is the height of the original image, U is the width of the original imageImshow (IMG); % here Y is the height of the transformed image, and X is the width of the transformed Image[V u] = size (IMG );Theta = jiaodu/180 * PI;Rot = [cos (theta)-sin
) * Y (3); 0 0 0 x (3) y (3) 1-y (3) * X (3) -Y (3) * Y (3); X (4) y (4) 1 0 0 0-X (4) * X (4)-X (4) * Y (4); 0 0 0 x (4) y (4) 1-y (4) * X (4)-y (4) * Y (4)]; fa = inv (a) * B; % the solution of the equation obtained by four points is also the global transformation coefficient A = FA (1); B = FA (2 ); C = FA (3); D = FA (4); E = FA (5); F = FA (6); G = FA (7 ); H = FA (8); rot = [d e f; a B C; G H 1]; % in the formula, the first number is X, and the
When the program encountered triangular function when I was confused, so Baidu "junior trigonometric Functions",Forget about these formulas, and punch yourself in the face.The goal is to draw a pentagram through canvas,Breakthrough: As long as the radius of the given two outer punctuate, and the radius of the inner punctuate, with the above formula to calculate the coordinates of each pentagram point.The main code is as follows:"300" means the radius of the outer ring."150" refers to the radius
e-er and son ear bait Behr Two-second rounds of spent valve method June fan Fan alum Vanadium fan all annoying anti-return fan-Fang Fang Fatty room anti-nuisance imitation visit textile put phenanthrene non-brown fly fat bandits dis bark lung waste boiling fee Fen Fen fen powder fen angry dung Feng Feng seal maple Bee Feng Feng wind crazy feng Sewing, Feng Buddha whether the husband apply the skin hatch, the body of the body of fluorine fu fu metre Francis Fu Fu Fu, the arm of the axe of the in
Java source code: {code...} Source: www. cnblogs. commailin... Java source code:
Import java. security. security; import javax. crypto. cipher; import javax. crypto. secretKey; import javax. crypto. spec. secretKeySpec; public class ThreeDES {private static final String Algorithm = "DESede"; // defines the encryption Algorithm. DES, DESede, Blowfish // keybyte can be used as the encryption key, the length is 24 bytes // src is the encrypted data buff
Symmetric encryption algorithmDefinition: In the symmetric encryption algorithm, the sender of the data sends the plaintext (raw data) and the encryption key (Mi Yue) together with a special encryption algorithm, which makes it into a complex cipher cipher. After receiving the ciphertext, if you want to interpret the original text, it is necessary to decrypt the ciphertext by using the encryption key and th
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.