Raftale Blog

「离开世界之前 一切都是过程」

System design: stock exchange

target: stock exchange system Step 1 - Understand the Problem and Establish Design scope functional requirements trade: only stocks order type: limit order normal trading hours basic fun...

Cryptography I - 05: stream ciphers - real-world -examples

Old example: RC4 (1987) used in HTTPS and WEB Weaknesses: Bias in initial output: Pr[ 2nd byte = 0 ] = 2/256 Prob. of (0,0) is 1/2562 + 1/2563 Related key attacks RC4 is unsecure!! ...

React 06 Add Interactivity

Responding to Events 1 2 3 4 5 6 7 8 9 10 11 12 export default function Button() { function handleClick() { alert('You clicked me!'); } return ( <button onClick={handleClick}>...

Cryptography I - 04: stream ciphers - Attack on stream ciphers and the one time pad

Attack1: two time pad is insecure!! Never use stream cipher key more than once !! $C_1 = m1 \oplus PRG(k)$ $C_2 = m2 \oplus PRG(k)$ Eavesdropper does: $C_1 \oplus C_2 = m_1 \oplus m_2$ Enou...

Cryptography I - 03: stream ciphers - pseudorandom generators

Stream cipher stream cipher: making the one time paid more practical. idea: replace “random” key by “pseudorandom” key. pseudo random generator: PRG PRG is a function. G: {0, 1}^s -> {0, 1}^n...

Cryptography I - 02: stream ciphers - one time pad

Symmetric Ciphers: definition A cipher is defined over (K, M, C) K is key space M is this set of all possible messages C is this set of all possible ciphertexts. the cipher itself is a pai...

React 05 Describing The Ui

Your First Component Component names must start with a capital letter or they won’t work! Importing and Exporting Components export components的方式有两种: default export named expo...

React 04 Installation

How to start a new React project React 框架 Next.js:全栈的React框架,由Vercel维护 Remix:具有嵌套路由的全栈式React框架 Gatsby:快速的支持CMS的网站。 Expo: 适合创建原生UI的应用 将React添加到现有的项目中 在现有网站的子路由中使用 React 在现有页面的一部分中...

React Quick Start: Thinking in React

Step 1: Break the UI into a component hierarchy 一个页面可以拆分成多个component,正确的拆分是良好设计的开端。 上图中就是一个良好的层级拆分,为了可维护性,一个component应该保持单一职责的原则。 Step 2: Build a static version in React 实现代码的第一步首先是用静态数据 先构建一个...

Cryptography I - 01: What is Cryptography about?

Course Overview cryptography is everywhere Secure communication: HTTPS, 802.11i WPA2, GSM, Bluetooth Encryption files on disk: EFS, TrueCrypt Content protection: CSS, AACS User authentic...