Skip to content

Commit

Permalink
1. Update docs
Browse files Browse the repository at this point in the history
2. Remove zip module
  • Loading branch information
T5750 committed Mar 29, 2020
1 parent 79248c5 commit 6314310
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 31 deletions.
10 changes: 9 additions & 1 deletion doc/source/security/secureHash.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ It’s main advantages are that it is fast, and easy to implement. But it also m
## Making MD5 more secure using salt
>Wikipedia defines salt as **random data that are used as an additional input to a one-way function that hashes a password or pass-phrase**. In more simple words, salt is some randomly generated text, which is appended to the password before obtaining hash.
**Important**: We always need to use a `SecureRandom` to create good salts, and in Java, the `SecureRandom` class supports the `SHA1PRNG` pseudo random number generator algorithm, and we can take advantage of it.
**Important**: We always need to use a [SecureRandom](https://docs.oracle.com/javase/6/docs/api/java/security/SecureRandom.html) to create good salts, and in Java, the `SecureRandom` class supports the `SHA1PRNG` pseudo random number generator algorithm, and we can take advantage of it.

`SHA1PRNG` algorithm is used as cryptographically strong pseudo-random number generator based on the `SHA-1` message digest algorithm. Note that if a seed is not provided, it will generate a **seed** from a true random number generator (**TRNG**).

Expand All @@ -29,6 +29,14 @@ Java has 4 implementations of SHA algorithm. They generate the following length
- `SHA-384` (Stronger than `SHA-256` – 384 bits Hash)
- `SHA-512` (Stronger than `SHA-384` – 512 bits Hash)

A longer hash is more difficult to break. That’s the core idea.

To get any implementation of algorithm, pass it as parameter to `MessageDigest`. e.g.
```
MessageDigest md = MessageDigest.getInstance("SHA-1");
//OR
MessageDigest md = MessageDigest.getInstance("SHA-256");
```
`SHATest`

## Advanced password security using PBKDF2WithHmacSHA1 algorithm
Expand Down
1 change: 1 addition & 0 deletions doc/source/utils/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ Utils
:maxdepth: 3
:numbered: 0

zip
gson/index
7 changes: 2 additions & 5 deletions utils/zip/README.md → doc/source/utils/zip.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# zip

## Runtime Environment
- [Java 7](http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html)
# Zip

## Short & Quick introduction
### 数据压缩概述
Expand Down Expand Up @@ -56,5 +53,5 @@ public void setTime(long time) | 设置条目的修改时间
### 如何对JAR文件进行操作呢?
Java档案文件(JAR)格式是基于标准的ZIP文件格式,并附有可选择的文件清单列表。可以使用`java.util.jar`包。

## Links
## References
- [利用JAVA API函数实现数据的压缩与解压缩](https://www.ibm.com/developerworks/cn/java/l-compress/index.html)
2 changes: 1 addition & 1 deletion utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Contents
- [hyperic-sigar](hyperic-sigar/README.md)
- [zip](zip/README.md)
- [Zip](../doc/source/utils/zip.md)

### Gson
- [Gson](../doc/source/utils/gson/gson.md)
Expand Down
1 change: 0 additions & 1 deletion utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

<modules>
<module>hyperic-sigar</module>
<module>zip</module>
</modules>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ibm.zip;
package t5750.utils.zip;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ibm.zip;
package t5750.utils.zip;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ibm.zip;
package t5750.utils.zip;

import java.io.*;
import java.util.zip.ZipEntry;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ibm.zip.checksum;
package t5750.utils.zip.checksum;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ibm.zip.checksum;
package t5750.utils.zip.checksum;

import java.io.*;
import java.util.zip.Adler32;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ibm.zip.employee;
package t5750.utils.zip.employee;

import java.io.Serializable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ibm.zip.employee;
package t5750.utils.zip.employee;

import java.io.FileInputStream;
import java.io.ObjectInputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ibm.zip.employee;
package t5750.utils.zip.employee;

import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
Expand Down
15 changes: 0 additions & 15 deletions utils/zip/pom.xml

This file was deleted.

0 comments on commit 6314310

Please sign in to comment.