-
Follow
- What is a monoalphabetic cipher ?
- How large is the key space of the monoalphabetic cipher applied to English (just consider lower case letters) ?
- What is the main security weakness of a monoalphabetic cipher ?
- Please provide at least 4 approaches to prevent the above weakness.
-
Block ciphers process messages in blocks like an extremely large substitution, but this is very difficult to implement for a very big block size. What is Shannon's idea to realize a block cipher with big block size ?
-
The S-box of DES round operation is not invertable, but why DES can decrypt ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
// in AES, GF(2^8), m(x) = x^8 + x^4 + x^3 + x + 1 | |
class GaloisField { | |
public: | |
unsigned char v[32]; | |
int n; | |
GaloisField() { | |
n = 8; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <limits.h> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
class IMAGE { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
const int N = 100009; | |
int ec,son[N],lnk[N * 2],nxt[N * 2],col[N],fa[N]; | |
struct lct | |
{ | |
int l[N],r[N],p[N],sz[N],w[N]; | |
void init(int n) | |
{ | |
++n; | |
for (int i = 0; i <= n; ++i) l[i] = r[i] = p[i] = sz[i] = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <limits.h> | |
#include <vector> | |
using namespace std; | |
class OfflineRMQ { | |
public: | |
static const int MAXN = 500005; | |
static const int MAXQ = 500005; | |
struct Node { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* TypeError: undefined is not a function | |
``` | |
{% blockquote%} -> {% blockquote %} | |
``` | |
* Error: expected end of comment, got end of file | |
``` | |
{% XXX %} \text{#YYY} {% endXXX %} -> {% XXX %} \text{YYY} {% endXXX %} | |
``` | |
* void `{{` or `}}` or `{#` or `#}` in markdown file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
$ npm install mkdirp --save | |
$ node hexo-migrate.js _post/ | |
$ cd file_migrate/_post | |
*/ | |
var fs = require("fs"); | |
var path = require("path"); | |
var mkdirp = require("mkdirp"); | |
function file_migrate(file_path) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Monokai-ish dark color scheme | |
# background = 39 40 34 (#272822) | |
defaults write TeXShop background_R 0.15 | |
defaults write TeXShop background_G 0.16 | |
defaults write TeXShop background_B 0.13 | |
# commands = 102 217 239 (#66D9EF) | |
defaults write TeXShop commandred 0.4 | |
defaults write TeXShop commandgreen 0.85 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
#define _GNU_SOURCE | |
#include <pthread.h> | |
#include <unistd.h> | |
#include <sched.h> | |
#include <errno.h> |