Skip to content

Instantly share code, notes, and snippets.

View morris821028's full-sized avatar
💭
I may be slow to respond.

Morris Yang, Shiang-Yun Yang morris821028

💭
I may be slow to respond.
View GitHub Profile
@morris821028
morris821028 / gist:702e07fa3910d402de4f
Created April 22, 2015 03:37
Information Security : exam 1
  1. Follow

    1. What is a monoalphabetic cipher ?
    2. How large is the key space of the monoalphabetic cipher applied to English (just consider lower case letters) ?
    3. What is the main security weakness of a monoalphabetic cipher ?
    4. Please provide at least 4 approaches to prevent the above weakness.
  2. 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 ?

  3. The S-box of DES round operation is not invertable, but why DES can decrypt ?

#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;
@morris821028
morris821028 / paper.md
Created April 27, 2015 03:40
虛擬實境 論文研讀

title: 虛擬實境 論文研讀 date: 2015-04-27 09:55:00 tags: [] categories: [學校課程, 虛擬實境]

期末上繳報告啊,不知道要寫多少才對得起自己。理解正確性不敢保證,相當可怕。

單詞概要

@morris821028
morris821028 / gist:4b6738d6ba83e8971df7
Last active August 29, 2015 14:25
b452: 傻傻地幫人數錢錢.cpp
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <vector>
#include <algorithm>
using namespace std;
class IMAGE {
@morris821028
morris821028 / QTREE6.cpp
Last active August 29, 2015 14:27 — forked from anonymous/QTREE6.cpp
QTREE6-lct
#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;
@morris821028
morris821028 / gist:700cec3da5224318bbbb
Last active August 29, 2015 14:27
Zerojudge d539 code
#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 {
@morris821028
morris821028 / hexo3.1.1.txt
Last active August 29, 2015 14:27
Hexo 2.8.3 to 3.1.1 錯誤訊息紀錄
* 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
@morris821028
morris821028 / hexo-migrate.js
Created August 19, 2015 02:40
hexo 2.8.3 to 3.1.1 tag plugin migrate
/*
$ 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) {
@morris821028
morris821028 / gist:12b7cb5ba3dfae8468b5
Created October 4, 2015 01:07
Mac TexShop Monokai-ish dark color scheme
# 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
#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>