Chair Professor Chin-Chen Chang (張真誠) National Tsing Hua University

Slides:



Advertisements
Similar presentations
Chubaka Producciones Presenta :.
Advertisements

布林代數的應用--- 全及項(最小項)和全或項(最大項)展開式
:Word Morphing ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10508:word morphing 解題者:楊家豪 解題日期: 2006 年 5 月 21 日 題意: 第一行給你兩個正整數, 第一個代表下面會出現幾個字串,
1 集合論 Chapter 3. 2 Chapter 3 Set Theory 3.1 Sets and Subsets A well-defined collection of objects (the set of outstanding people, outstanding is very.
:New Land ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11871: New Land 解題者:施博修 解題日期: 2011 年 6 月 8 日 題意:國王有一個懶兒子,為了勞動兒子,他想了一個 辦法,令他在某天早上開始走路,直到太陽下山前,靠.
1. 假設以下的敘述為一未提供 “ 捷徑計算 ” 能力的程式段,試用程 式設計的技巧,使此敘述經此改 寫的動作後,具有與 “ 捷徑計算 ” 之 處理方法相同之處理模式。 if and then E1 else E2 endif.
2012 JANUARY Sun Mon Tue Wed Thu Fri Sat
: Make a Crystal ★★★★★ 題組: Problem Set Archive with Online Judge 題號: 11094: Make a Crystal 解題者:呂彥澂 解題日期: 2007 年 4 月 17 日 題意:在 N*N*N 的空間中 (N 為偶數.
3.1 矩陣的行列式 3.2 使用基本運算求行列式 3.3 行列式的性質 3.4 特徵值介紹 3.5 行列式的應用
: Multisets and Sequences ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11023: Multisets and Sequences 解題者:葉貫中 解題日期: 2007 年 4 月 24 日 題意:在這個題目中,我們要定義.
最短路徑演算法 卓訓榮 2002/11/11 Data base Label Setting Algorithm Label Correcting Algorithm 運輸資訊.
: Beautiful Numbers ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11472: Beautiful Numbers 解題者:邱經達 解題日期: 2011 年 5 月 5 日 題意: 若一個 N 進位的數用到該.
JAVA 程式設計與資料結構 第二十章 Searching. Sequential Searching Sequential Searching 是最簡單的一種搜尋法,此演 算法可應用在 Array 或是 Linked List 此等資料結構。 Sequential Searching 的 worst-case.
演算法 8-1 最大數及最小數找法 8-2 排序 8-3 二元搜尋法.
演算法課程 (Algorithms) 國立聯合大學 資訊管理學系 陳士杰老師 Course 7 貪婪法則 Greedy Approach.
P Pathophysiology Calendar. SundayMondayTuesdayWednesdayThursdayFridaySaturday January 2012.
:Count the Trees ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10007:Count the Trees 解題者:楊家豪 解題日期: 2006 年 3 月 題意: 給 n 個點, 每一個點有自己的 Label,
: Finding Paths in Grid ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11486: Finding Paths in Grid 解題者:李重儀 解題日期: 2008 年 10 月 14 日 題意:給一個 7 個 column.
1 Knapsack Cryptosystems 2 ◎ Merkle-Hellman Knapsack Cryptosystem 觀察: (1) 0/1 knapsack problem (i.e. sum of subset) 例:已知 C = 14, A = (1, 10, 5, 22, 3)
1 Introduction to Java Programming Lecture 3 Mathematical Operators Spring 2009.
: How many 0's? ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11038: How many 0’s? 解題者:楊鵬宇 解題日期: 2007 年 5 月 15 日 題意:寫下題目給的 m 與 n(m
Whole School Attendance Whole School Attendance 94.64% Overall School Absence 5.36%
Discrete Mathematics Chapter 4 Induction and Recursion 大葉大學 資訊工程系 黃鈴玲 (Lingling Huang)
WORD JUMBLE. Months of the year Word in jumbled form e r r f b u y a Word in jumbled form e r r f b u y a february Click for the answer Next Question.
DATE POWER 2 INCOME JANUARY 100member X 25.00P2, FEBRUARY 200member X 25.00P5, MARCH 400member X 25.00P10, APRIL 800member.
直角三角形與同餘數 (Congruent Numbers) 台師大數學系 紀文鎮
Discrete Mathematics Section 3.7 Applications of Number Theory 大葉大學 資訊工程系 黃鈴玲.
17th 12th 14th 1st 2nd 3rd 6th 9th 22nd 21st 29th30th 31st 18th 6th Let’s Say 说说看 序数词 Revision.
2011 Calendar Important Dates/Events/Homework. SunSatFriThursWedTuesMon January
ID-base Signature from Pairings on Elliptic Curve Kenneth G. Paterson From IACR Server 2002/004 Reference :Identity-Based Encryption from the Weil Pairing.
July 2007 SundayMondayTuesdayWednesdayThursdayFridaySaturday
BASIC Programming Language. Overview Install Just BASIC Run BASIC Programs Syntax of BASIC –Data, Variables, and Calculations –Input/Output –Decisions.
Data Structures Chapter 8: Hashing 8-1. Performance Comparison of Arrays and Trees Is it possible to perform these operations in O(1) ? ArrayTree Sorted.
IN THIS Slide show YOU WILL LEARN ABOUT ALL VERSIONS OF "MS OFFICE"
Review Graph Directed Graph Undirected Graph Sub-Graph
Chair Professor Chin-Chen Chang Feng Chia University
Dictation practice 2nd Form Ms. Micaela-Ms. Verónica.
McDonald’s Kalender 2009.
McDonald’s Kalender 2009.
Chair Professor Chin-Chen Chang Feng Chia University
1   1.テキストの入れ替え テキストを自由に入れ替えることができます。 フチなし全面印刷がおすすめです。 印刷のポイント.
January MON TUE WED THU FRI SAT SUN
January MON TUE WED THU FRI SAT SUN
McDonald’s Kalender 2009.
January Sun Mon Tue Wed Thu Fri Sat
January MON TUE WED THU FRI SAT SUN
January MON TUE WED THU FRI SAT SUN
Problem Gambling Clicks to Opgr.org
2300 (11PM) September 21 Blue line is meridian..
January MON TUE WED THU FRI SAT SUN
McDonald’s calendar 2007.
1 - January - Sun Mon The Wed Thu Fri Sat
Teacher name August phone: Enter text here.
January MON TUE WED THU FRI SAT SUN
JANUARY 1 Sun Mon Tue Wed Thu Fri Sat
January MON TUE WED THU FRI SAT SUN
JANUARY 1 Sun Mon Tue Wed Thu Fri Sat
The Transformation of A Small Company Into A Golden Legend
Hiding Information in VQ Index Tables with Reversibility
What we learn with pleasure we never forget. Alfred Mercier
January MON TUE WED THU FRI SAT SUN
S M T W F S M T W F
JANUARY 1 Sun Mon Tue Wed Thu Fri Sat
McDonald’s calendar 2007.
1 January 2018 Sun Mon Tue Wed Thu Fri Sat
Habitat Changes and Fish Migration
2015 January February March April May June July August September
Habitat Changes and Fish Migration
Hiding Information in VQ Index Tables with Reversibility
Presentation transcript:

Toward the Applications of Chinese Remainder Theorem in Computer Science Chair Professor Chin-Chen Chang (張真誠) National Tsing Hua University National Chung Cheng University Feng Chia University http://msn.iecs.fcu.edu.tw/~ccc

1. Chinese Remainder Theorem (中國剩餘定理) 2. Ordered Minimal Perfect Hashing Functions (OMPHF) 3. Data Field Protection 4. Access Control 5. Conclusions

Chinese Remainder Theorem (中國剩餘定理) 韓信點兵問題:「今有物不知其數,三三數之剩二,五五數之剩三,七七數之剩二,問物幾何?」~(孫武 孫子算經) 亦即 求正整數C,使得 C ≡ 2 (mod 3) C ≡ 3 (mod 5) C ≡ 2 (mod 7) 兩個疑問? (1) C是否存在? (2) 如何求C?

回答(1):中國剩餘定理 Let r1,r2,…,rn be integers. an integer C. st. C ≡ r1 (mod m1) C ≡ r2 (mod m2) . C ≡ rn (mod mn) If (mi, mj)=1,

EX:令m1=3,m2=5,m3=7,且令 r1=2,r2=3,r3=2, C=23, s.t. C mod m1 = 23 mod 3 = 2, C mod m2 = 23 mod 5 = 3, C mod m3 = 23 mod 7 = 2.

回答(2): 「三人同行七十稀 五樹梅花廿一枝 七子團圓正半月 除百零五便得知。」 ~(程大位 算法統宗(1593))

亦即 70×2+21×3+15×2 =140+63+30 =233 233÷105= 餘23

Ordered Minimal Perfect Hashing Functions Non-linear Organization Ex: binary tree Linear Organization

h hashing key to address transformation problem: collision particular cases (1) one-to-one mapping and | key space | ≤ | address space | h Perfect hashing

Minimal perfect hashing (2)one-to-one mapping and | key space | = | address space| Minimal perfect hashing Ex: key set={20, 21, …, 217} h(k) = k mod 19 is a perfect hashing

Minimal Perfect Hashing since

Minimal Perfect Hashing (Cont.) Some questions

Minimal Perfect Hashing (Cont.) Ans(1): Chinese Remainder Theorem

Minimal Perfect Hashing (Cont.) Ans(2): Use Prime Number Functions Ans(3):

Minimal Perfect Hashing (Cont.) Ex: m1=4, m2=5, m3=7, m4=9 C' bi Mi i

Applications-12 months English identifiers JANUARY FEBRUARY MARCH APRIL MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOVEMBER DECEMBER

Applications-12 months English identifiers (Cont.) Extract (The 2nd char., The 3rd char.) (A, N) (E, B) (A, R) (P, R) (A, Y) (U, N) (U, L) (U, G) (E, P) (C, T) (O, V) (E, C)

Applications-12 months English identifiers (Cont.) Group Location Extraction pair Original key 1 2 3 (A, N) (A, R) (A, Y) JANUARY MARCH MAY 4 (C, T) OCTOBOR 5 6 7 (E, B) (E, C) (E, P) FEBRUARY DECEMBER SEPTEMBER 8 (O, V) NOVEMBER 9 (P, R) APRIL 10 11 12 (U, G) (U, L) (U, N) AUGUST JULY JUNE

Applications-12 months English identifiers (Cont.) x d(x) c(x) p(x) A B C D E F G H I J K L M 3 4 161896 1 427 2 5 7 11 13 17 19 23 29 31 37 41 x d(x) c(x) p(x) N O P Q R S T U V W X Y Z 7 8 9 1 12989 43 47 53 59 61 67 71 73 79 83 89 97 101 H(P, R) = d(P) + (c(P) mod p(R)) = 8 + (1 mod 61) = 8 +1 = 9

36 Pascal Reserved Words ARRAY, AND, BEGIN, CASE, CONST, DOWNTO, DO, DIV, END, ELSE, FUNCTION, FILE, FOR, GOTO, IF, IN, LABEL, MOD, NIL, NOT, OTHERWISE, OF, OR, PROCEDURE, PROGRAM, PACKED, REPEAT, RECORD, SET, TYPE, THEN, TO, UNTIL, VAR, WITH, WHILE

AA, AD, BI, CE, CS, DN DO, DV, ED, EE, FC, FE GO, IF, IN, LE, MD, NL NT, OE, OF, OR, PC, PG PK, RE, RO, ST, TE, TN TO, UI, VR, WH, WL

H(W, L) = d(W) + (c(W) mod p(L)) = 34 + (39 mod 37) = 34 + 2 = 36 x d(x) c(x) p(x) A B C D E F G H I J K L M 2 3 5 8 10 13 14 16 17 9 1 672 50010 57 3236 131 7 11 19 23 29 31 37 41 x d(x) c(x) p(x) N O P Q R S T U V W X Y Z 18 20 23 26 28 29 32 33 34 1777 3785 726 331 1 15654 39 43 47 53 59 61 67 71 73 79 83 89 97 101 H(W, L) = d(W) + (c(W) mod p(L)) = 34 + (39 mod 37) = 34 + 2 = 36

The Occurrence of the j-th field Data Field Protection α1 α2 … αj … αm Record R *e1 *e2 *ej *em ∑ mod D Record R’s Ciphertext C C mod dj The Occurrence of the j-th field

Data Field Protection (Cont.) Example: Let R = (4, 10, 2) be a record. Take d1=7, d2=11 and d3=5 to be R’s three deciphering keys. Then D=d1×d2×d3=7×11×5=385. The following are encryption keys

Data Field Protection (Cont.) Because α1=4, α2=10 and α3=2, we have C = (e1α1+e2α2+e3α3) mod D. Thus R’s ciphertext is C = (330×4+210×10+231×2) mod 385=32 . Then we have α1= C mod d1= 32 mod 7 =4, α2= C mod d2= 32 mod 11 =10, and α3= C mod d3= 32 mod 5 =2.

Data Field Protection (Cont.) When α2 is changed from 10 to 8, R’s ciphertext becomes C = (C-e2(C mod d2) + e2×8) mod D = (32 -210×10 + 210×8) mod 385 = -388 mod 385 = 382.

Access Control M1 M2 M3 M4 P1 P2 Access Matrix R W E Own R W R W E Own

Access Control (Cont.) File User Database Program File System Table

Access Control (Cont.) 0 : No access 1 : Execute 2 : Read 3 : Write File 0 : No access 1 : Execute 2 : Read 3 : Write 4 : Own User

Key_Lock Pair A. Wu and Hwang [1984] aij=Ki*Lj (1) * :inner product of Galois Field GF(p) (2) p>aij and p is a prime number Step1:Find a 5*5 Non_Singular Matrix

Key_Lock Pair (Cont.) Step 2: K1=(3, 1, 5, 6, 5) K2=(1, 2, 3, 5, 3) L1=(X1, X2, X3, X4, X5). Ki*L1=ai1, i= 1, 2, …, 5.

Key_Lock Pair (Cont.) 4=3X1+X2+5X3+6X4+5X5 3=X1+2X2+3X3+5X4+3X5  L1=(1, 3, 0, 1, 4)

Key_Lock Pair (Cont.)

Key_Lock Pair (Cont.) Example: K4*L1=(2, 6, 1, 1, 2)*(1, 3, 0, 1, 4) =2+18+0+1+8 = 29 29 mod 7 = 1# Disadvantage: (1) Space: O(m2+mn) > O(mn) (2) Time: 1. m multiplications 2. m-1 additions 3. 1 divisions ※ m users and n files.

Key_Lock Pair (Cont.) B. Chang [1985] a45=K4 mod L5 =415976 mod 13 =2 aij=Ki mod Lj Lock Key Example: a45=K4 mod L5 =415976 mod 13 =2

Key_Lock Pair (Cont.) Questions?? (1) Why aij = Ki mod Lj ? (2) How to find Ki’s 與 Lj’s ? Answer (1) Chinese Remainder Theorem Let r1 , r2 , …, rn be integers ,  an integer K s.t. … r1 … r2  … rn If (Li, Lj) = 1,  ij.

Key_Lock Pair (Cont.) Ex: Answer(2): Lock: L1, L2,…,Ln, coprimes 4 4 L2=6 L3=7 1 L4=11 2 L5=13 L6=17 Answer(2): Lock: L1, L2,…,Ln, coprimes

Key_Lock Pair (Cont.) Key Example L1=5, L2=6, L3=7, L4=11, L5=13, L6=17 D1=L2L3L4L5L6=6*7*11*13*17=102102 D2=L1L3L4L5L6=5*7*11*13*17=85085 D3=L1L2L4L5L6=5*6*11*13*17=72930 D4=L1L2L3L5L6=5*6*7*13*17=46410 D5=L1L2L3L4L6=5*6*7*11*17=39270 D6=L1L2L3L4L5=5*6*7*11*13=30030

Key_Lock Pair (Cont.) ∵ Djbj  1 ( mod Lj) ∴ b1 = 3, b2 = -1, b3 = -12, b4 = 1, b5 = 4, b6 = 15. K1= bjDja1j = 3 * 102102 * 4 + (-1) * 85085 * 4 + (-12) * 72930 * 1 + 1 * 46410 * 2 + 4 * 39270 * 0 + 15 * 30030 * 0 = 102544 ● If Mb  1 ( mod m), where (M,m)=1, is there any efficient way to find b? Mx+my=1 (e.g. 8x+3y=1), find (x,y)=? ● How to deal with large Ki ?

Conclusions Design a perfect hashing function to allow insertion and deletion of keys How to speed up the calculation of C? Multi-key hashing How to deal with large Ki problem? Apply Data Field Protection to Secure Broadcasting More applications?