Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
hakavlad committed Mar 30, 2024
1 parent 04887d1 commit cff5915
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 68 deletions.
72 changes: 10 additions & 62 deletions docs/examples/8.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,15 @@

## Create files with uniform random data
## Creating files with uniform random data

Random data files can be used as keyfiles and as containers (for embedding cryptoblobs into them) (and for any other arbitrary purposes, of course).
Random data files can be used:

You can create files with random data of any size by selecting option 8 in the menu.
- as keyfiles;
- as containers (for embedding cryptoblobs into them);
- for any other arbitrary purposes.

Next, you need to enter the path to the file to be created and the desired size.
You can create files with random data of any size by selecting option 8 in the menu. Next, you need to enter the path to the file to be created and the desired size.

#### Create an empty file:

```
$ tird
MENU
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0. Exit 1. Show info
2. Encrypt 3. Decrypt
4. Embed 5. Extract
6. Encrypt & embed 7. Extract & decrypt
8. Create w/ random 9. Overwrite w/ random
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[01] Select an option [0-9]: 8
I: action #8: create a file with random bytes
[07] Output file: 0b
I: path: "0b"
[14] Output file size in bytes: 0
I: size: 0 B
I: writing data...
I: written 0 B
I: action is completed
```

#### Create an empty file with debug messages enabled:

```
$ tird -d
W: debug messages enabled!
MENU
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0. Exit 1. Show info
2. Encrypt 3. Decrypt
4. Embed 5. Extract
6. Encrypt & embed 7. Extract & decrypt
8. Create w/ random 9. Overwrite w/ random
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[01] Select an option [0-9]: 8
I: action #8: create a file with random bytes
[07] Output file: 0b
D: real path: "/tmpfs/0b"
D: opening file "0b" in mode "wb"
D: opened file (object): <_io.BufferedWriter name='0b'>
I: path: "0b"
[14] Output file size in bytes: 0
I: size: 0 B
I: writing data...
I: written 0 B
D: closing <_io.BufferedWriter name='0b'>
D: <_io.BufferedWriter name='0b'> closed
I: action is completed
```

#### Create 1 kB file:
#### Creating 1 kB file:

```
$ tird
Expand All @@ -85,7 +33,7 @@ I: written 1000 B, 100.0% in 0.0s, avg 13.1 MiB/s
I: action is completed
```

#### Create 1 kB file with debug messages enabled:
#### Creating 1 kB file with debug messages enabled:

```
$ tird -d
Expand Down Expand Up @@ -115,7 +63,7 @@ D: <_io.BufferedWriter name='1kB'> closed
I: action is completed
```

#### Create 1 GB file:
#### Creating 1 GB file:

```
$ tird
Expand All @@ -140,7 +88,7 @@ I: written 1000000000 B, 953.7 MiB, 100.0% in 7.6s, avg 126.0 MiB/s
I: action is completed
```

#### Create 2 GB file with debug messages enabled:
#### Creating 2 GB file with debug messages enabled:

```
$ tird -d
Expand Down
10 changes: 4 additions & 6 deletions docs/examples/9.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

## Overwrite file contents with uniform random data
## Overwriting file contents with uniform random data

`tird` can partially or completely overwrite the contents of files with random data.
`tird` can partially or completely overwrite the contents of files with random data. You can select positions in the file (from 0 to the end of the file) between which the contents will be overwritten with random data.

You can select positions in the file between which the contents will be overwritten with random data.

#### Overwrite the entire 1 MB file contents with random bytes:
#### Overwriting the entire 1 MB file contents with random bytes:

```
$ tird
Expand Down Expand Up @@ -36,7 +34,7 @@ I: fsynced in 0.0s
I: action is completed
```

#### Overwrite the entire 1 MB file contents with random bytes with debug messages enabled:
#### Overwriting the entire 1 MB file contents with random bytes with debug messages enabled:

```
$ tird -d
Expand Down

0 comments on commit cff5915

Please sign in to comment.