meditationatae

Just another WordPress.com site

Bash script to encipher given file 10 times in aes-256-cbc with initialization vector

To start, copy the “random” file to:

aesrandom_bestofthree.bin0

The purpose of encrypting 10 times with AES-256 in CBC mode is to obscure any relationship with the *.wav file on the insecure Windows 10 laptop. Done on a Linux box running CentOS 6.8 x64 in SELinux enforcing mode:

 

(script follows with actual values of keys used last time):

 

#!/bin/bash
openssl enc -aes-256-cbc -in aesrandom_bestofthree.bin0 -out aesrandom_bestofthree.bin1 -e -K “a327df2d119f2f6ec73606eeeb320b875a247ee657098bd5394946b580fc15b5” -iv “ea2f50e196c57dfacb7e141d66f54f57”
chmod go-rwx aesrandom_bestofthree.bin1
openssl enc -aes-256-cbc -in aesrandom_bestofthree.bin1 -out aesrandom_bestofthree.bin2 -e -K “553da66e55faa98eb7d9c65dc502f544086a04c333bb7435e306aad3df8fa0e6” -iv “56fc7c8abfd1812f81bf897ddda36b42”
chmod go-rwx aesrandom_bestofthree.bin2
openssl enc -aes-256-cbc -in aesrandom_bestofthree.bin2 -out aesrandom_bestofthree.bin3 -e -K “6f68baa5066c20d1bc65c5a4f362bd1c82dc7729b7916123570e1260939e5993” -iv “745dd5ce91f35e79b4cff4fde98085a0”
chmod go-rwx aesrandom_bestofthree.bin3
openssl enc -aes-256-cbc -in aesrandom_bestofthree.bin3 -out aesrandom_bestofthree.bin4 -e -K “b2575b91b5d6be4e50743895460c0005915d8322ec917ebcebcf7fcd5cf362cc” -iv “28f9c2483c26959afbea6707595a68b9”
chmod go-rwx aesrandom_bestofthree.bin4
openssl enc -aes-256-cbc -in aesrandom_bestofthree.bin4 -out aesrandom_bestofthree.bin5 -e -K “a826761518043298b7ef273f5846c1c7466b630f1331330b3a4c98ad96a42430” -iv “7f67d08fea5ee370eb32bac9cb4012ee”
chmod go-rwx aesrandom_bestofthree.bin5
openssl enc -aes-256-cbc -in aesrandom_bestofthree.bin5 -out aesrandom_bestofthree.bin6 -e -K “a71ad2d66503f825d062860dd83dee8da7245a5170fca9beee2f175b2ed1b1f7” -iv “fb0d3d338eccec7f587815f50875c812”
chmod go-rwx aesrandom_bestofthree.bin6
openssl enc -aes-256-cbc -in aesrandom_bestofthree.bin6 -out aesrandom_bestofthree.bin7 -e -K “f46ff3795936c2833a10b39ebbb32b6fcd51fbecd50ee3064512822258f9f2a7” -iv “b84f19d6281926cd292a290f46bd221b”
chmod go-rwx aesrandom_bestofthree.bin7
openssl enc -aes-256-cbc -in aesrandom_bestofthree.bin7 -out aesrandom_bestofthree.bin8 -e -K “595fb519eb35739f4732dad23846582ab7ba21e1bd3fdf1ebf7c5acb0b989d23” -iv “cfaeabe69249d36949d15393ff5ea927”
chmod go-rwx aesrandom_bestofthree.bin8
openssl enc -aes-256-cbc -in aesrandom_bestofthree.bin8 -out aesrandom_bestofthree.bin9 -e -K “6475d2a36c689c697727463c306c8090e8e527a49f4dfc7d1de05a90042c6d9b” -iv “c8b424e9f7e9a276bd40c287653cadfc”
chmod go-rwx aesrandom_bestofthree.bin9
openssl enc -aes-256-cbc -in aesrandom_bestofthree.bin9 -out aesrandom_bestofthree.bin10 -e -K “a3863f9fdead1dfbb16317f7efa7ec11a4ca515310690237222c09280e9612b4” -iv “5ab11fc5ea7086002d1eaa34eba3eb83”
chmod go-rwx aesrandom_bestofthree.bin10
rm aesrandom_bestofthree.bin0
rm aesrandom_bestofthree.bin1
rm aesrandom_bestofthree.bin2
rm aesrandom_bestofthree.bin3
rm aesrandom_bestofthree.bin4
rm aesrandom_bestofthree.bin5
rm aesrandom_bestofthree.bin6
rm aesrandom_bestofthree.bin7
rm aesrandom_bestofthree.bin8
rm aesrandom_bestofthree.bin9
mv aesrandom_bestofthree.bin10 aesrandom_bestofthree.bin0

 

END OF SCRIPT ABOVE

 

Written by meditationatae

January 14, 2017 at 7:48 pm

Posted in History

Extracting the least significant bit from the Least significant bytes of the left channel

For the 434,099,244-byte *.wav file mentioned in the previous post, I want to look only at the Left channel (first half of 32 bits for each time-slot), and look at the Least significant bytes; these will be bytes 45, 49 and so on with the convention that the first byte of the file is byte 1. From these Left channel Least significant bytes, I want the parity, or the least significant bit of that byte.

The C programming language source code below does that job, printing 8 least significant bits per line:
filename: newdecode14b.c

#include <stdio.h>   // you know what I mean

int main(void)
{
int j;
unsigned char car;
unsigned char uc1;
unsigned char bitwiseand;
FILE *in;

uc1 = (unsigned char) 1;

in = fopen(“/home/david/ZIPfiles/Jan_14_2016/noise/test14JAN2017.wav”, “r”);

for(j=0; j<44; j++)
{
fscanf(in, “%c”, &car);
}

for(j=44; j< 434099244 ; j++)
{
fscanf(in, “%c”, &car);

if( (0 == (j%4)) )
{
bitwiseand = car&uc1;
printf(“%d “, bitwiseand);
}

if(8 == (j%32))
{
printf(“\n”);
}
}

fclose(in);
return 0;
}

End of source code.

 

 

$ head new_rand_bytes13565600
0 0 1 1 1 1 1 1
0 1 1 1 1 1 0 0
0 1 0 1 0 0 1 1
1 1 1 1 0 1 1 1
1 1 1 1 1 0 1 0
1 1 0 0 1 0 0 1
0 1 0 1 1 0 1 0
1 0 0 1 1 0 1 1
1 1 1 0 0 0 1 1
1 0 0 0 1 1 1 0

$ wc new_rand_bytes13565600
13565600 108524800 230615200 new_rand_bytes13565600

This tells us the file of bits has 13,565,600 lines.
At 8 “random” bits per line, it’s enough to give
13,565,600 “random” bytes, hence the filename:
” new_rand_bytes13565600 ” .

Written by meditationatae

January 14, 2017 at 6:27 pm

Posted in History

Checking headers of new *wav file, and source code

I used the TV tuner of an old analog TV to generate 434 megabytes of white noise, in stereo audio, recorded with Audacity on Windows.
I used Winzip to zip this, and burn it to a CD using Toshiba Disc Creator. Toshibiba disc creator complained at the end (this is Windows 10) that “this was not possible and Toshiba disc creator would be terminated”, or somesuch; all indicates that this is a bogus warning (from Toshiba or Windows, whatever).
I expected this *.wav file to be in stereo which means Left and Right channels, at 16 bits for each sample on each channel, and sample 44100 times per second: this is something like uncompressed CD stereo quality (or Red Book standard).
The verification on Linux through the 44-byte Headers:

[david@localhost noise]$ ./decode01a.out

1: 82 R
2: 73 I
3: 70 F
4: 70 F

5: 36
6: 212
7: 223
8: 25

9: 87 W
10: 65 A
11: 86 V
12: 69 E

13: 102 f
14: 109 m
15: 116 t
16: 32 Space

17: 16
18: 0
19: 0
20: 0

21: 1 PCM = Pulse coded modulation = normal
22: 0

23: 2 2 channels (as expected)
24: 0

25: 68
26: 172 172*256 + 68 = 44100 = Sample Rate per second, each channel . Ok.
27: 0
28: 0

29: 16
30: 177
31: 2 2*256^2 + 177*256 + 16 = 176400 bytes/second
32: 0

33: 4 (BitsPerSample * Channels) / 8 = (16*2)/8 = 4 bytes per time-slot, Ok.
34: 0

35: 16 16 bits per sample, on each channel = Normal, Ok.
36: 0

37: 100 d
38: 97 a
39: 116 t
40: 97 a

41: 0 25*256^3 + 223*256^2 + 212*256 + 0 =
42: 212 = 434099200 bytes data
43: 223 = 434099244 – 44 bytes of data, all Ok.
44: 25

=== END of HEADERS ===============

45: 18 // now, 4 first bytes or 32 bits of data, setereo,
46: 216 // 16 bits per sample, per channel…
47: 9
48: 216 // self-consistency PASSED.

N.B. I consulted topherlee dot com for this:
http://www.topherlee.com/software/pcm-tut-wavformat.html
( Highly recommended for *wav headers ).

I wrote a program in the C programming language to read the *wav file, and display the first 100 bytes of the file as decimal numbers in the range 0 to 255 (no characters, bits or hex digits…).

Source code of decode01a.c :

#include

int main(void)
{
int j;
unsigned char car;
FILE *in;

in = fopen(“/home/david/ZIPfiles/Jan_14_2016/noise/test14JAN2017.wav”, “r”);

for(j=0; j<100; j++)
{
fscanf(in, "%c", &car);
printf("%3d: ", j+1);
printf("%3d\n", car);
}

fclose(in);
return 0;
}

Further in the data section we have 32 bit values per time-slot of:

117: 38 // Least significant byte, left channel
118: 2 // Most significant byte, left channel
119: 36 // Least significant byte, right channel
120: 2 // Most significant byte, right channel

121: 77 // Least significant byte, left channel
122: 3 // Most significant byte, left channel
123: 68 // Least significant byte, right channel
124: 3 // Most significant byte, right channel

125: 82 // Least significant byte, left channel
126: 1 // Most significant byte, left channel
127: 96 // Least significant byte, right channel
128: 1 // Most significant byte, right channel

The Left and Right channel numbers are quite similar,
the laptop used has two microphones, and the samples from
left and right will be correlated. Therefore, for random numbers,
I discard the right channel (second group of two bytes).
Among the Most significant byte and the Least significant byte
for a channel, the Most significant byte varies little from one
sample to the next. So for random numbers, I discard
all Most significant bytes. This leaves us with
the Least significant byte(s) of left channel,
which vary somewhat. 38, 77, 82 from above.
The rule of thumb I use is to use only the
least significant bit of this byte, or the parity, so
38, 77, 82 yields: 0, 1, 0. [ parity bit, least significant bit].

Written by meditationatae

January 14, 2017 at 4:43 pm

Posted in History

Analysis of header of WAV audio file

The numbers 1 through 100 below followed by a colon ( : )
mark bytes 1 through 100 in a WAVE audio file,
with extension .wav .
The decimal value of the character is first given,
followed by its ASCII value, or “Extended ASCII”
for values 128-255.

I’ve followed the explanations from topherlee dot com
at the Web page:

< http://www.topherlee.com/software/pcm-tut-wavformat.html >

in the table following the line:

” The header of a WAV (RIFF) file is 44 bytes long and has the following format: ”
For large integer values, the base used is 256,
so that sample rate:

68
172
0
0

reads as:
68 + 172*256 = 44100 (sampling rate)

and as another example, in positions 41-44,
the “File size (data)” section, or:

0
122
103
25

reads as:
0 + 122*256 + 103*256*256 + 25*256*256*256 = 426,211,840.

David Bernier

January 3 2017

Analysis of header of wave audio file:

1: 82 = R
2: 73 = I
3: 70 = F
4: 70 = F
Marks the file as a riff file.

5: 36 = $
6: 122 = z
7: 103 = g
8: 25 = EM
Size of the overall file, in bytes = 426,211,876 bytes.
( 426,211,884 bytes according to “ls”, extra 8 bytes .)
9: 87 = W
10: 65 = A
11: 86 = V
12: 69 = E
File Type Header = “WAVE”
13: 102 = f
14: 109 = m
15: 116 = t
16: 32 = Space
Format chunk marker
17: 16 = DLE
18: 0 = NULL
19: 0 = NULL
20: 0 = NULL
Length of format data = 16 bits/sample
For each channel.

21: 1 = SOH
22: 0 = NULL
Type of format = 1 , for PCM

23: 2 = STX
24: 0 = NULL
Number of Channels = 2

25: 68 = D
26: 172 = Extended ASCII
27: 0 = NULL
28: 0 = NULL
Sample Rate = 44100

29: 16 = DLE
30: 177 = Extended ASCII
31: 2 = STX
32: 0 = NULL
(Sample Rate * BitsPerSample * Channels)/ 8 = 176,400 bytes/second
33: 4 = EOT
34: 0 = NULL
(BitsPerSample * Channels) / 8 = 4.

35: 16 = DLE
36: 0 = NULL
Bits per sample = 16.
37: 100 = d
38: 97 = a
39: 116 = t
40: 97 = a
“data” chunk header.

41: 0 = NULL
42: 122 = z
43: 103 = g
44: 25 = EM
File size = 426,211,840 bytes of DATA .
+ 44 bytes of Header = 426,211,884 bytes in TOTAL. Check Ok.
HEADER DONE.

DATA BELOW: chunked in bytes of 8 bits.

45: 220 = Extended ASCII
46: 0 = NULL
47: 208 = Extended ASCII
48: 0 = NULL

49: 241 = Extended ASCII
50: 1 = SOH
51: 252 = Extended ASCII
52: 1 = SOH

53: 244 = Extended ASCII
54: 0 = NULL
55: 235 = Extended ASCII
56: 0 = NULL

57: 62 = >
58: 0 = NULL
59: 97 = a
60: 0 = NULL

61: 177 = Extended ASCII
62: 252 = Extended ASCII
63: 181 = Extended ASCII
64: 252 = Extended ASCII

65: 74 = J
66: 248 = Extended ASCII
67: 131 = Extended ASCII
68: 248 = Extended ASCII

69: 32 = Space
70: 246 = Extended ASCII
71: 1 = SOH
72: 246 = Extended ASCII

73: 23
74: 243
75: 50
76: 243

77: 193
78: 240
79: 214
80: 240

81: 152
82: 238
83: 133
84: 238

85: 255
86: 235
87: 58
88: 236

89: 202
90: 235
91: 165
92: 235

93: 202
94: 235
95: 236
96: 235

97: 53
98: 235
99: 38
100: 235

Written by meditationatae

January 4, 2017 at 5:08 am

Posted in History

a pie in the sky, via the number pi

47300001440770837983734454576162797577879920843837
94800196494427397773038074457387242127660580344021
34682405672126117207785330713414725880593538622654
73975346789773528716600646099932086922357957513492
19756674977305514622634030328067458751013787784885
52829130701073553360162668964463849584071037989913
70486688507994164230666343846674772239240996578903
84568896596451691438428661400890138003041956812810
48591097845251333303104811878603134699136170321975
21568568008502682629819933494624991123862758037223
66019333985981335732480675719265596255491446373799
85178314543906137623414300072437733561943392327043
11884647664463258520202541596231127245136231675622
78619188463016003795639891877182667908801433087053
86290947746644289701355540789696029178210197711709
36545045216872695211681704230649415248953739143673
84812737858390027387981773891609505236508874427301
63038487050158000935975235813062017437144370741479
43915145713587433606973804719686386308885337719433
17041703164332734923888858226543443505628024815340

 

Written by meditationatae

August 26, 2016 at 2:54 am

Posted in History

Mission accomplished in Re: emails (sent…)

copy follows……

 

Subject: Original (carbon copy) of the Notification to Paule Vallieres, Special care counsellor, Quebec City, Canada

 

(original or carbon copy of Notification follows)



NOTICE TO: PAULE VALLIERES, St Brigid’s and Jeffery Hale, Quebec City :



(1) All future meetings in your capacity as Special care counsellor, or
any other capacity, are hereby unilaterally cancelled by me, DAVID
PATRICK BERNIER.



(2) You, Paule Vallieres, are HEREBY instructed by me to never contact
me again.


(3) You, Paule Vallieres, are hereby instructed by me to never attempt
to contact me again.


(4) You, PAULE VALLIERES are hereby instructed by me to never call me
again: I will not answer the phone.


(5) You, PAULE VALLIERES, are hereby instructed by me to never attempt
to call me again.



(6) YOU, PAULE VALLIERES, are hereby instructed to never contact me by
email again.



(7) YOU, PAULE VALLIERES, are hereby instructed to never attempt to
contact me by email again.



(8) YOU, PAULE VALLIERES, are hereby instructed by me to never contact
me by mail again.



(9) YOU, PAULE VALLIERES, are HEREBY instructed by me to never attempt
to contact me by mail again.



(10) YOUR COOPERATION IN THESE MATTERS, PAULE VALLIERES, WILL BE
WELCOMED BY ME.



DONE AT QUEBEC CITY, CANADA, THIS THIRTEENTH DAY OF JULY IN THE YEAR OF
OUR LORD TWO THOUSAND AND SIXTEEN.



AND I HEREBY AFFIX A TOKEN OF MY SIGNATURE:



DAVID PATRICK BERNIER

QUEBEC CITY, PROVINCE OF QUEBEC

CANADA.

===



ORIGINAL/CARBON-COPY BY email TO THE FOLLOWING LIST:



(a) PAULE VALLIERES ***** at ssss.gouv.qc.ca [ Original ]



(b) AIMEE BERGERON:  ***** at ssss.gouv.qc.ca [cc #1 ]



(c) Madame Brigitte Paquette, directrice des services généraux et
communautaires, (DSGC), 1250 chemin Sainte-Foy, Quebec (QC), G1S 2M6

(sous pli separe, by separate cover).  [separate cover #1 ]



(d) my relative A* [ cc #2 ]

(e) my aunt E*    [ cc #3 ]

(f) my late father at jpbern ….  [ cc #4 ]



(g) myself at videotron    [ cc #5 ]


(h) myself at YAHOO mail = ezcos. [ cc #6  ]



SO PROMISED, SO DONE.


“Verba volant, scripta manent.”

Written by meditationatae

July 13, 2016 at 9:39 am

Posted in History

NOTICE TO: PAULE VALLIERES, St Brigid’s and Jeffery Hale, Quebec City

(1) All future meetings in your capacity of Special care counsellor, or any other capacity, are hereby unilaterally cancelled by me, DAVID PATRICK BERNIER.

 

(2) You, Paule Vallieres, are HEREBY instructed by me to never contact me ever again.

(3) You, Paule Vallieres, are hereby instructed by me to never attempt to contact me again.

(4) You, PAULE VALLIERES are hereby instructed by me to never attempt to call me again: I will not answer the phone.

(5) You, PAULE VALLIERES, are hereby instructed by me to never attempt to call me again.

 

(6) YOU, PAULE VALLIERES, are hereby instructed to never contact me by email again.

 

(7) YOU, PAULE VALLIERES, are hereby instructed to never attempt to contact me by email ever again.

 

(8) YOU, PAULE VALLIERES, are hereby instructed by me to never ever contact me by mail again.

 

(9) YOU, PAULE VALLIERES, are HEREBY instructed by me to never ever attempt to contact me by mail again.

 

(10) YOUR COOPERATION IN THESE MATTERS, PAULE VALLIERES, WILL BE WELCOMED BY ME.

 

DONE AT QUEBEC CITY, CANADA, THIS THIRTEENTH DAY OF JULY IN THE YEAR OF OUR LORD TWO THOUSAND AND SIXTEEN.

 

AND I HEREBY AFFIX A TOKEN OF MY SIGNATURE:

DAVID PATRICK BERNIER

QUEBEC CITY, PROVINCE OF QUEBEC

CANADA.

===

 

CARBON-COPY BY email TO THE FOLLOWING LIST:

 

(a) PAULE VALLIERES ***** at ssss.gouv.qc.ca

 

(b) AIMEE BERGERON:  ***** at ssss.gouv.qc.ca

 

(c) Madame Brigitte Paquette, directrice des services généraux et communautaires, (DSGC), 1250 chemin Sainte-Foy, Quebec (QC), G1S 2M6

(sous pli separe, by separate cover).

 

(d) my relative A*

(e) my aunt E*

(f) my late father at jpbern ….

 

(g) myself at videotron

(h) myself at YAHOO mail = ezcos.

 

SO PROMISED, SO DONE.

“Verba volant, scripta manent.”

 

 

Written by meditationatae

July 13, 2016 at 8:23 am

Posted in History