Chen Jian

Network Security Essentials — Notes3. Message Authentication

1. Message Authentication   a. Msg is not altered   b. Msg is indeed from the alleged sender   c. Msg is has not been artifically delayed or replayed 2.Two Techniques of Authentication    a. Encrypt the whole message before sending         Msg is authentic <=> encrypted msg can be successfully decrypted      Reversable Encryption/Decryption …

Network Security Essentials — Notes3. Message Authentication Read More »

Network Security Essentials — Notes2. Symmetric Ciphers

1. Overview   Symmetric Ciphers use the same key for both decryption and encryption.   Other terms for symmetric-key encryption are secret-key, single-key, shared-key,  one-key, and private-key encryption. 2. 5 Indredients   a.Plaintext   b.Encryption Algorithm   c.Secret Key   e.Ciphertest   f.Decryption Algorithm Algorithms are not kept secret, but keys are 3.Two kinds of …

Network Security Essentials — Notes2. Symmetric Ciphers Read More »

Network Security Essentials — Notes1. Introduction

‘Network Security Essentials: Applications and Standards’, by Dr. William Stallings There is a systematic way of defining security requirements — X.800 Security Architecture for OSI 1. The architecture defines,   a. Attack   b. Service  — detecting and preventing Attacks   c. Mechanism — implements Service 2. Attack    a.Passive Attack       i. Release of …

Network Security Essentials — Notes1. Introduction Read More »

什么情况下应该将IOException包装成RuntimeException抛出,什么情况下不应该?

如果某个方法自己负责 流的打开/关闭,那这个方法就可以把IOException包装成RuntimeException再抛出 如果某个方法不负责流的打开和关闭,那它就应该把IOException如实抛出,上层的某个方法再根据这个IOException来关闭流 如果某个方法只不打开流,却要负责流的关闭,那这种写法本身就错了…… 谁打开,谁关闭,是处理IO流的一个准则。

关于网络安全, William Stallings 有两本书

一本是久负盛名的 ‘Cryptography and Network Security’ 另一本是 ‘Network Security Essentials: Applications and Standards’ 据作者的说法,第二本是从第一本中 "Adapt" 而来。 两本书的区别在于第一本有大量的篇幅放在密码学的数学原理上,而第二本则没有。 我们是程序员,不是算法专业研究生,所以第二本更适合我们。

跨层的API不好重用

这是老生常谈。但有时候你在争论时有可能一时间举不出任何例子,所以这里就写一个例子来阐述这个简单的道理。 比如说,网页上某表单的输入校验中引用了Session中的对象,在Servlet环境中这没问题;但有一天,客户要求提供一个Web Service,实现这个表单相同的功能,那就没办法重用这段校验代码,因为Web Service里找不到也不需要这个Session对象。 深入一点,可以说:     每个API都有个核心逻辑,这个逻辑的性质决定了它应处的层次;如果这个API引用该层次的上一层(比如Service引用了Session),那这个API就没办法重用;但如果它引用的是下一层(比如Service引用了DAO),那它的重用性就不受影响。

[POI-HSSF] 例示Logical Row/Column 和 Physical Row/Column 的区别

HSSF是处理Excel的API. 在这个API的语境中,Row/Column 有 "Logical" 和 "Physical" 的区别。 Logical和Physical分别是什么意思? 我不敢望文生义,去网上搜又搜不到,最后只好自己测试一下。 你看了下面的测试结果,就知道这两个东西的区别了: totallyEmpty.xls (全空的Excel) get Physical NumberOfRows: 0 get Logical FirstRowNum: 0 get Logical LastRowNum: 0 —-Let’s walk through the physical rows: 没有东西可遍历 —-Let’s walk through the logical rows: 没有东西可遍历 excelPath: row_2_4_6.xls (1、3、5行为空,2、4、6不空,1-based) get Physical NumberOfRows: 3 get Logical FirstRowNum: 0 get Logical LastRowNum: 5 —-Let’s walk …

[POI-HSSF] 例示Logical Row/Column 和 Physical Row/Column 的区别 Read More »