Go Back   Sat Universe > Encryptions > Encryptions chat

Note: Visitors from certain countries might see in-text advertising(underlind words in posts) or pop-under ads.
It is only shown to unregistered visitors or members that haven't made any posts. So you can easily get rid of it.

World-Of-Satellite

Encryption Learning

Encryptions chat

Reply
  #1  
Old 27-06-2021, 03:03  Translate from English to Italian  Translate from English to French  Translate from English to German  Translate from English to Spanish  Translate from English to Dutch  Translate from English to Greek  Translate from English to Portuguese  Translate from English to Russian  Translate from English to Russian
cayoenrique cayoenrique is offline
Senior Member
 
Join Date: May 2018
Posts: 200
Thanks: 149
Thanked 458 Times in 117 Posts
Country: Country Flag
Default Encryption Learning

I have to write a post with negative comments. But because I want to be positive I decided to offer basic help instead. I said basic because I am no expert. So the offer is open if some one is interested.

Now, the reason I am posting this is because I been approach by members with the weird none sense comments.

One member claim he wants to build a new bruteforce tool but have no knowledge of the status of current encryption protocol.

Another member want to break today most used/secure encryption protocol (AES-128) but have no idea what the "at" and "dot" are in the email address syntax.

This is not about bulling those guys. I have not mention any name. They may have good intentions. But when you chose a goal you need to chose one you can reach, at least in the next 10 years.

Never the less all this can be learn. You just need to start from the basic.

So if you are interested in encryption, you need 1rst to understand what is we encrypt or decrypt. Start with;

https://en.wikipedia.org/wiki/MPEG_transport_stream

Download this PDF:
An introduction to MPEG-TS
https://tsduck.io/download/docs/mpegts-introduction.pdf
Reply With Quote
The Following 13 Users Say Thank You to cayoenrique For This Useful Post:
dijitalxyz (04-08-2021), draculasat (11-07-2021), HimbaLimba (11-07-2021), iq180 (29-06-2021), localhosthack0r (29-06-2021), MickeEst (29-06-2021), Plasma70 (03-07-2021), sahafe (01-07-2021), siawoosh (27-06-2021), Steboni (12-08-2021), van basten (03-07-2021), ViaHussun (03-07-2021), voomvoom (28-06-2021)
  #2  
Old 28-06-2021, 09:53  Translate from English to Italian  Translate from English to French  Translate from English to German  Translate from English to Spanish  Translate from English to Dutch  Translate from English to Greek  Translate from English to Portuguese  Translate from English to Russian  Translate from English to Russian
cayoenrique cayoenrique is offline
Senior Member
 
Join Date: May 2018
Posts: 200
Thanks: 149
Thanked 458 Times in 117 Posts
Country: Country Flag
Default

I will do a few post as a test. But I will need feedback to know if it is wanted or not.

Methods of randomizing data or make them atleast difficult to understand

In general the method of encryption is the only that requires a Key shared betwwen sender and receiver.


Lets see some definitions.

Symmetric encryption algorithms use only one secret key to both encrypt and decrypt the data.
Asymmetric encryption algorithms use two keys, not one. This consists of a public key and a private key.
Hashing is similar to encryption in that it scrambles the input data into a randomized or near-randomized output data. Hashing differs significantly from encryption, however, in that it is a one-way process.
“Salting the hash” is the process of adding extra, randomized characters to the password.
Definitions taken from: https://cybernews.com/security/hashing-vs-encryption/

Scrambler is a device that manipulates a data stream before transmitting.
https://en.wikipedia.org/wiki/Scrambler

Obfuscation is the obscuring of the intended meaning of communication by making the message difficult to understand
https://en.wikipedia.org/wiki/Obfuscation

Encoding is a system of rules to convert information into another form.
https://en.wikipedia.org/wiki/Encoding
Reply With Quote
The Following 11 Users Say Thank You to cayoenrique For This Useful Post:
Asaawe (03-07-2021), barney115 (29-06-2021), draculasat (11-07-2021), iq180 (29-06-2021), localhosthack0r (29-06-2021), MickeEst (29-06-2021), Plasma70 (03-07-2021), sahafe (01-07-2021), tuvalo (29-06-2021), ViaHussun (03-07-2021), voomvoom (16-07-2021)
  #3  
Old 28-06-2021, 10:26  Translate from English to Italian  Translate from English to French  Translate from English to German  Translate from English to Spanish  Translate from English to Dutch  Translate from English to Greek  Translate from English to Portuguese  Translate from English to Russian  Translate from English to Russian
cayoenrique cayoenrique is offline
Senior Member
 
Join Date: May 2018
Posts: 200
Thanks: 149
Thanked 458 Times in 117 Posts
Country: Country Flag
Default

I do not want to get on your nerve with what I think of Windows. I use Linux. If you are into testing, then I strongly suggest you start learning Linux. For small test a Virtual machine can be fine. But I suggest you learn to double boot your laptop or PC. We can open another thread if you like to learn to boot your PC in Linux from USB or CD. Let me know.

For this Lab1, I will assume that you can access openssl in a prompt. I will show your prompt as "#:"

Lets start by executing:
Code:
#:echo "This message should not be read by all"
And you should see as output
Code:
#:This message should not be read by all
#:
The echo command serve to print what is between the "". It is like is we did press that line on the keyboard. Now lets do some Obfuscation by Scramble or encoding the message.
Code:
#:echo "This message should not be read by all" | openssl base64
And you should see as output
Code:
#:VGhpcyBtZXNzYWdlIHNob3VsZCBub3QgYmUgcmVhZCBieSBhbGwK
#:
What had happened? First we have the echo. It serves as if we did key that line in the keyboard. Then you see "|". This is a pipe just as a pipe take the output of something it pass it as input of the next. Well "|" takes the output of echo and give it as input to the nest command. The next command is openssl base64. This tells openssl to translate the input into base64 form. And we get as output
Code:
#:VGhpcyBtZXNzYWdlIHNob3VsZCBub3QgYmUgcmVhZCBieSBhbGwK
#:
So as result "This message should not be read by all" translate to "VGhpcyBtZXNzYWdlIHNob3VsZCBub3QgYmUgcmVhZCBieSBhbGwK"

We can then use the opposite command to return our Obfuscated-Scrambled-encoded the message to the original form.

Code:
#:echo "VGhpcyBtZXNzYWdlIHNob3VsZCBub3QgYmUgcmVhZCBieSBhbGwK"| openssl base64 -d
Note the command seems the same exept for "-d" witch instruct openssl not to encode but to decode.

And we should get
Code:
#:This message should not be read by all
#:
Just an assignment for you to read:
https://en.wikipedia.org/wiki/Base64
https://en.wikipedia.org/wiki/OpenSSL

Last edited by cayoenrique; 28-06-2021 at 10:35..
Reply With Quote
The Following 13 Users Say Thank You to cayoenrique For This Useful Post:
Asaawe (03-07-2021), draculasat (11-07-2021), dvlajkovic (29-06-2021), iq180 (29-06-2021), localhosthack0r (29-06-2021), MickeEst (29-06-2021), sahafe (01-07-2021), Stunner34 (03-07-2021), tuvalo (29-06-2021), van basten (03-07-2021), ViaHussun (03-07-2021), voomvoom (16-07-2021), Xamoulis (24-07-2021)
  #4  
Old 29-06-2021, 07:10  Translate from English to Italian  Translate from English to French  Translate from English to German  Translate from English to Spanish  Translate from English to Dutch  Translate from English to Greek  Translate from English to Portuguese  Translate from English to Russian  Translate from English to Russian
cayoenrique cayoenrique is offline
Senior Member
 
Join Date: May 2018
Posts: 200
Thanks: 149
Thanked 458 Times in 117 Posts
Country: Country Flag
Default

I seen no reply and only 3 thanks so far. I will post one more session.

What we saw previously is NOT Encryption as no Keys where used to do the transform. Still base64 is very useful. You can take a binary file and convert it to text. As the new transform is text then you can Paste the transformed in to an Email or a used it to paste the binary file in our forum PM system.

Now lets do some Encryption. Lets do again our past exercise but have it encrypted. So we need a KEY. lets chose a one that fit our needs. So for now on we will used as our Key:
Code:
www.sat-universe.com
Now Some openssl description
Code:
Explaining arguments:
enc stands for encryption
-aes-128-cbc is a good way of using a AES cipher
-a base64 your data after encryption or before decryption
-d decrypt
-e encrypt
-in input file
-out output file
-pbkdf2 streches the key to it would be hard to break Key Derivation Function
-iter iterations to strech the key, more means more security and adequate number is described here
-md sha512 is replacing the hash function of PBKDF2 with SHA512 which is more secure than the default SHA256
-salt not mentioned in the command because it is set by default and is a very good way to increase security, why is that is described
So our new command to have the message string encrypted in AES-128 and have it bas64 is:

Code:
#:echo "This message should not be read by all" | openssl aes-128-cbc -a -pbkdf2 -k www.sat-universe.com
You should see
Code:
U2FsdGVkX19WKkmJaAqoS8HrwAh8xtkC9JonQ4S5DST87hbrwdvwansi/L9/T+8MqGKQ80oZbzcajT+qG8QeQg==
To decrypt
Code:
#:echo "U2FsdGVkX19WKkmJaAqoS8HrwAh8xtkC9JonQ4S5DST87hbrwdvwansi/L9/T+8MqGKQ80oZbzcajT+qG8QeQg==" | openssl aes-128-cbc -a -pbkdf2 -k www.sat-universe.com -d
You should see
Code:
This message should not be read by all
Now we could use this technique to build yourself and Applet, that can take a "Copy" hit The Aplet Icon in the tool bar and do automatic encryption/decryption so that we can Paste transform!! Nice do you agree...
Reply With Quote
The Following 17 Users Say Thank You to cayoenrique For This Useful Post:
Asaawe (03-07-2021), draculasat (11-07-2021), dvlajkovic (29-06-2021), HimbaLimba (11-07-2021), iq180 (29-06-2021), jenseneverest (06-07-2021), juli13 (29-06-2021), lespat (29-06-2021), localhosthack0r (29-06-2021), MickeEst (30-06-2021), sahafe (01-07-2021), Stunner34 (03-07-2021), tuvalo (29-06-2021), van basten (03-07-2021), ViaHussun (03-07-2021), voomvoom (16-07-2021), Xamoulis (24-07-2021)
  #5  
Old 30-06-2021, 03:43  Translate from English to Italian  Translate from English to French  Translate from English to German  Translate from English to Spanish  Translate from English to Dutch  Translate from English to Greek  Translate from English to Portuguese  Translate from English to Russian  Translate from English to Russian
cayoenrique cayoenrique is offline
Senior Member
 
Join Date: May 2018
Posts: 200
Thanks: 149
Thanked 458 Times in 117 Posts
Country: Country Flag
Default

I had assume threads is for novice or any one that need a refresh. Anyone can post, with comment or question. I am no expert, but I will respond best I can and give ALL the treatment of a novice. So no one is wrong or right we are just interchanging what we think is correct. I see more thanks I will assume we can continue.

If I have time soon I provide some sort of script or status applet to automate.

Prerequisites
openssl - to be used for basic encryption. I know I forgot to mention at the beginning.
xz-utils - xz mode, best compression in tar
wget - to download file without need of browser
bless - hex editor, to edit binary files
xpdf - light pdf reader

To install do
Code:
apt-get install openssl xz-utils wget bless xpdf
File magic number
"This is a list of file signatures, data used to identify or verify the content of a file. Such signatures are also known as magic numbers or Magic Bytes. "
Are the very first binary digits in a file.
https://en.wikipedia.org/wiki/List_of_file_signatures
Code:
25 50 44 46 2D 			%PDF-		.pdf 	PDF document
FD 37 7A 58 5A 00 		ý7zXZ		.tar.xz XZ compression utility using LZMA2 compression	
53 61 6C 74 65 64 5F 5F		Salted__ 	.???	openssl salted (-pbkdf2)
??? - there is no standard file type for encryption in 128 or 256. For the purpose of this tutorial we will use .AES128 & .AES256

Text book
Now I will start by saying we need some sort of text book. There is many resources in internet. One of my best is a thesis:
Quote:
On the Security of Digital Video Broadcast Encryption
Markus Diett October 26, 2007
So until now we have transformed small phrases or messages in quotes. But we can transform/encrypt full files and or directory. For files we used the in and out. For directories what we do is add another pipe with the tar command. This allow us then to compress the data too.

Remeber in openssl for file we used
Code:
-in input file
-out output file
As we are using Linux lets show you how easy is.

0) 1rst make sure we have internet as we are going to download a pdf.
1) Get a terminal prompt.
2) lets make a working directory in our Home dir
3) lets change terminal to working dir
4) lets download pdf using wget
5) lets compress file using tar
6) lets encrypt file

...To continue

Last edited by cayoenrique; 30-06-2021 at 03:50..
Reply With Quote
The Following 8 Users Say Thank You to cayoenrique For This Useful Post:
Asaawe (03-07-2021), draculasat (13-07-2021), dvlajkovic (30-06-2021), iq180 (30-06-2021), sahafe (01-07-2021), Stunner34 (03-07-2021), ViaHussun (03-07-2021), voomvoom (16-07-2021)
  #6  
Old 30-06-2021, 04:01  Translate from English to Italian  Translate from English to French  Translate from English to German  Translate from English to Spanish  Translate from English to Dutch  Translate from English to Greek  Translate from English to Portuguese  Translate from English to Russian  Translate from English to Russian
cayoenrique cayoenrique is offline
Senior Member
 
Join Date: May 2018
Posts: 200
Thanks: 149
Thanked 458 Times in 117 Posts
Country: Country Flag
Default

Code:
#:echo "My Home dir is: $HOME" 
#:mkdir -p $HOME/cryptodir/books
#:cd $HOME/cryptodir/books
#:wget https://www.emsec.ruhr-uni-bochum.de/media/crypto/attachments/files/2010/04/da_diett.pdf
#:tar cfJ da_diett.pdf.xz da_diett.pdf
#:openssl aes-256-cbc -pbkdf2 -k www.sat-universe.com -in da_diett.pdf.xz -out da_diett.pdf.xz.AES256
You should see:
Code:
#: echo "My Home dir is: $HOME"
My Home dir is: /home/user
#: mkdir -p $HOME/cryptodir/books
#: cd $HOME/cryptodir/books
#: wget https://www.emsec.ruhr-uni-bochum.de/media/crypto/attachments/files/2010/04/da_diett.pdf
--2021-06-29 21:47:40--  https://www.emsec.ruhr-uni-bochum.de/media/crypto/attachments/files/2010/04/da_diett.pdf
Resolving www.emsec.ruhr-uni-bochum.de (www.emsec.ruhr-uni-bochum.de)... 134.147.62.207
Connecting to www.emsec.ruhr-uni-bochum.de (www.emsec.ruhr-uni-bochum.de)|134.147.62.207|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 657410 (642K) [application/pdf]
Saving to: ‘da_diett.pdf’

da_diett.pdf                     100%[========================================================>] 642.00K   121KB/s    in 5.3s    

2021-06-29 21:47:48 (121 KB/s) - ‘da_diett.pdf’ saved [657410/657410]

#: tar cfJ da_diett.pdf.xz da_diett.pdf
#: openssl aes-256-cbc -pbkdf2 -k www.sat-universe.com -in da_diett.pdf.xz -out da_diett.pdf.xz.AES256
#:
And now you should see that you have
Code:
#: ls -l $HOME/cryptodir/books
total 1796
-rw-r--r-- 1 enrique enrique 657410 Apr 20  2010 da_diett.pdf
-rw-r--r-- 1 enrique enrique 586084 Jun 29 21:47 da_diett.pdf.xz
-rw-r--r-- 1 enrique enrique 586112 Jun 29 21:48 da_diett.pdf.xz.AES256
As you see we have now 3 files: da_diett.pdf da_diett.pdf.xz da_diett.pdf.xz.AES256

To open a pdf
Code:
#:xpdf da_diett.pdf
The others ones are binary and you can not edit on text editor. Instead we will open them in Hex editor. I will use linux bless hex editor. Now if you are new you will see a bunch of numbers that means nothing to you. That is fine. But the beginning of most binary files the first few bytes are called magic numbers. And they can tell you what king of file you are opening. See he table I show previously. In general you will see:

%PDF-
Code:
#:bless da_diett.pdf
ý7zXZ
Code:
#:bless da_diett.pdf.xz
[/b]Salted__[b]
Code:
#:bless da_diett.pdf.xz.AES256
...To continue
Reply With Quote
The Following 8 Users Say Thank You to cayoenrique For This Useful Post:
Asaawe (03-07-2021), draculasat (13-07-2021), dvlajkovic (30-06-2021), iq180 (30-06-2021), jenseneverest (06-07-2021), Stunner34 (03-07-2021), ViaHussun (03-07-2021), voomvoom (16-07-2021)
  #7  
Old 30-06-2021, 04:35  Translate from English to Italian  Translate from English to French  Translate from English to German  Translate from English to Spanish  Translate from English to Dutch  Translate from English to Greek  Translate from English to Portuguese  Translate from English to Russian  Translate from English to Russian
cayoenrique cayoenrique is offline
Senior Member
 
Join Date: May 2018
Posts: 200
Thanks: 149
Thanked 458 Times in 117 Posts
Country: Country Flag
Default

Finally lets compress and encrypt a Full Folder

0) Lets change directory to
1) Lets tar xz
2) Lets encrypt

Code:
#:cd $HOME/cryptodir
#:tar cfJ books.tar.xz books
#:openssl aes-256-cbc -pbkdf2 -k www.sat-universe.com -in books.tar.xz -out books.tar.xz.AES256
You should see
Code:
#: tar cfJ books.tar.xz books
#: openssl aes-256-cbc -pbkdf2 -k www.sat-universe.com -in books.tar.xz -out books.tar.xz.AES256
#: ls -l  /home/enrique/cryptodir
total 3440
drwxr-xr-x 2 enrique enrique     100 Jun 29 21:48 books
-rw-r--r-- 1 enrique enrique 1760172 Jun 29 22:14 books.tar.xz
-rw-r--r-- 1 enrique enrique 1760192 Jun 29 22:15 books.tar.xz.AES256
Notice how now I use .tar.xz but previouly I did .xz. All work, but the correct way is .tar.xz.

Now to get them back you 1rst decompress then decrypt. But we will decompress to Volatile memory, so that we do not override original files. In Linux Volatile memory is /tmp. This means that after reboot all in that folder will be gone.


Code:
tar -xJf books.tar.xz -C /tmp
#: ls /tmp
#: ls /tmp/books
#: xpdf /tmp/books/da_diett.pdf
You will see
Code:
#: tar -xJf books.tar.xz -C /tmp
#: ls /tmp
books  geany_socket.b2029e4c  serverauth.nUJa4IjPZ0  ssh-r4YCKEolvWDO
#: ls /tmp/books
da_diett.pdf  da_diett.pdf.xz  da_diett.pdf.xz.AES256
#: xpdf /tmp/books/da_diett.pdf
Last we did not decrypt as we did have a pdf file in the folder. But to decompres we only ad "-d" to our old openssl command.

Code:
#: mkdir /tmp/books/out
cd /tmp/books
#: openssl aes-256-cbc -pbkdf2 -k www.sat-universe.com -in da_diett.pdf.xz.AES256 -out out/da_diett.pdf.xz -d
#: cd /tmp/books/out
#: tar -xJf da_diett.pdf.xz
#: xpdf /tmp/books/da_diett.pdf
NOTE
The book da_diett.pdf is your assignment for you to read. This is about mpegts and show how CSA encryption is done.

Last edited by cayoenrique; 30-06-2021 at 04:48..
Reply With Quote
The Following 8 Users Say Thank You to cayoenrique For This Useful Post:
Asaawe (03-07-2021), draculasat (23-07-2021), dvlajkovic (30-06-2021), iq180 (30-06-2021), jenseneverest (06-07-2021), Stunner34 (03-07-2021), ViaHussun (03-07-2021), voomvoom (16-07-2021)
  #8  
Old 01-07-2021, 10:58  Translate from English to Italian  Translate from English to French  Translate from English to German  Translate from English to Spanish  Translate from English to Dutch  Translate from English to Greek  Translate from English to Portuguese  Translate from English to Russian  Translate from English to Russian
cayoenrique cayoenrique is offline
Senior Member
 
Join Date: May 2018
Posts: 200
Thanks: 149
Thanked 458 Times in 117 Posts
Country: Country Flag
Default

I need to make a short pause. I am a complicated soul. Half of the stuff I will be using is new to me too. If I try to teach you what I do I will confuse you even more. So I am doing my best.

What we have done.
1) I tried to express that breaking cryptography is harder than just knowing C or any of your preferred language.
2) But I hope I had prove to the novice that learning to encrypt is as easy as baking a cake. Get the tools, ingredients and follow the steps. Encryption tools are free and available to all.
3) I have suggested you can even used this methods to post Real Encrypted Private conversation in PM or Email system. No need for PGP neither.
4) Wanting to use Windows !!!!!…. this is a hard topic I know. You will tell me that Win GUI apps are Colorful & Beautiful, easier to use and now they even update automatically. There are 1001 more good reason to use windows I know. Now I hope I had show you that if you intent to do the wrongly called “FTA Testing” you will be better using none GUI regular Linux command apps. You will not waist hundred of man-hour-work by not having to write&test again what some one already done in Linux. Instead you add 1 command with associate parameter and like magic, do not have to worry about that.
5) I had give you Links to get information on , nalu, es, pes,ts, CSA.

TS or Transport Stream
You do not want to spent much time on this at the beginning. The more you do the more you get confuse. But at the end ( future), this is one of the most important thing. This is what you encrypt. This is one of the places you will try to find weakness so that you can break the encryption.

In general TS is packing process. Lets say you love potato chips. You buy them at COSTCO . You buy 1 Box containing 48 single bags. This box arrives at Cotsco in another bigger box that contain 24 units. Then many of this bigger Box come in a Metal Transport Container, that also goes ins a HUGE Ship that navigate have of the world. See my point, it been pack, repack with cardboard, plastic metal etc. Same is a TS container.

To help you, I will post best description I cam come up, not a correct one. Please forgive me.

ES - Elementary Stream
For me this is the most basic workable unit. Why, you can play 1 ES and be able to listen of view video. Well usually you need at lest 2 due to synchronization or detection of the code. Size varies depending on information represented, video vs audio etc. Basic data used by decoder. In our TS theory ES is a single audio or video not mix. But outside of the TS world, in reality a compound ES file contain all data to generate a video with audio.

PES – Packetized Elementary Stream
A few ES are joined to make a Data Packet, let say an audio frame. In TS, at this level Audio or Video are never mix.

TS - Transport Stream
TS is Multiplexed!!! Yes now TS has the overhead to add separated PIDs ( Packet identifiers ) with Audio or Video to make a Channel. And Multiple Channels can join to create a Full Transponder. A TS Line can only have 188 bytes. Now what this means, A PES is variable Big thing. So we will need Several TS of 188 to accommodate space for 1 PES.

I will show you with a sample.
To continue…
Reply With Quote
The Following 10 Users Say Thank You to cayoenrique For This Useful Post:
Asaawe (03-07-2021), draculasat (18-07-2021), dvlajkovic (02-07-2021), iq180 (03-07-2021), jenseneverest (06-07-2021), localhosthack0r (11-07-2021), Stunner34 (03-07-2021), van basten (03-07-2021), ViaHussun (03-07-2021), voomvoom (16-07-2021)
  #9  
Old 01-07-2021, 14:01  Translate from English to Italian  Translate from English to French  Translate from English to German  Translate from English to Spanish  Translate from English to Dutch  Translate from English to Greek  Translate from English to Portuguese  Translate from English to Russian  Translate from English to Russian
cayoenrique cayoenrique is offline
Senior Member
 
Join Date: May 2018
Posts: 200
Thanks: 149
Thanked 458 Times in 117 Posts
Country: Country Flag
Default

Lab002

Prerequisites
ffmpeg - is an audio/video conversion tool.
dvbsnoop - is a DVB / MPEG stream analyzer program, which enables you to watch (live) stream information in human readable form
tstools - is a set of cross-platform command line tools for working with MPEG data.

Code:
#: apt update
#: apt install dvbsnoop tstools ffmpeg
#: mkdir -p $HOME/cryptodir/Labs/002
#: cd $HOME/cryptodir/Labs/002
Now user your browser to download
Code:
https://www95.zippyshare.com/v/PoREC8IL/file.html
Note: I am not allowed to upload at the forum. So best I can do is upload to share up-loader. in this case zippyshare. Be aware it will not last more than 30 after last download.

Code:
#: tar -xf testcard_original.ts.tar.xz
ffplay -autoexit testcard_original.ts
As you see you can play testcard_original.ts usinf ffplay. This is a full 1 cycle of the Test Card.

I will re-code this file to make it FULL standard so that our outdated free opensource tools do not complain. Also this new file will only have 1 audio channel.

Code:
#: ffmpeg -i testcard_original.ts -vcodec mpeg2video -acodec mp2 -b:v 10M -b:a 192k -muxrate 10M -f mpegts testcard.ts
Now lets remove all TS and PES headers leavin Only a Compound Video & Audio ES.
Code:
#: ts2es testcard.ts testcard.ts.es
This command can show some info
Code:
#: esdots -v testcard.ts.es
Notice that We went from 4.5MM - 3.3MB to 601KB and still playable
Code:
#: ffplay -autoexit testcard.ts.es
To continue...
Attached Files
File Type: zip testcard_original.ts.zip (561.6 KB, 11 views)
File Type: zip da_diett.pdf.zip (578.5 KB, 9 views)

Last edited by cayoenrique; 01-07-2021 at 14:27..
Reply With Quote
The Following 9 Users Say Thank You to cayoenrique For This Useful Post:
alaa2003 (05-07-2021), alireal (03-07-2021), Asaawe (03-07-2021), draculasat (23-07-2021), dvlajkovic (02-07-2021), iq180 (03-07-2021), Stunner34 (03-07-2021), ViaHussun (03-07-2021), voomvoom (16-07-2021)
  #10  
Old 01-07-2021, 14:05  Translate from English to Italian  Translate from English to French  Translate from English to German  Translate from English to Spanish  Translate from English to Dutch  Translate from English to Greek  Translate from English to Portuguese  Translate from English to Russian  Translate from English to Russian
cayoenrique cayoenrique is offline
Senior Member
 
Join Date: May 2018
Posts: 200
Thanks: 149
Thanked 458 Times in 117 Posts
Country: Country Flag
Default

Lets start over again. For the purpose of simplicity I want only the Audio pid ES. Note it seems that 1rst Audio Pid with PUSI is at 3. Then after trial and error I found I need a minimum of 7 TS so that ffplay can play the sound. The end result is a file with 4 TS.
Code:
#: dvbsnoop -if testcard.ts -s ts -b 0x101 -n 7 > testcard_APID=0x0101_4ts.ts
Lets transform TS to ES
Code:
#: ts2es testcard_APID=0x0101_4ts.ts -pid 0x0101 testcard_APID=0x0101_4ts.es
Now lets compare the differences.

TS
Code:
#: od -t x1 --width=47 testcard_APID=0x0101_4ts.ts
0000000 47 41 01 30 01 40 00 00 01 c0 0b 48 80 80 05 21 00 07 d8 61 ff fd a4 04 66 33 33 44 33 44 44 22 33 33 33 6d b6 e4 6c 90 00 00 00 00 00 00 ff
0000057 0a aa aa ab ea be aa a8 dd 8d d9 0c 90 c8 9d da 27 76 d7 5d b6 d7 4d 74 d3 5d 36 d7 ad ba d3 6d b5 cf 5c b9 d3 4d 34 be fc 30 7e f9 f3 f7 cf
0000136 5d dd dd dd dd dd db d5 b1 b6 e4 9c 61 73 05 12 4a 9a 36 9b 65 b1 24 ae 46 63 4d b2 e1 57 38 da 23 dd a2 91 b5 df 3d 7c f9 eb e7 77 77 77 77
0000215 77 74 19 10 65 26 67 c8 89 12 44 9c b9 4d 36 9a 69 2b 74 93 4b 25 28 94 36 cd c4 69 11 45 12 a3 a7 cf dd 3e 7e e9 de 5d e1 dd dd dc be 55 c3
0000274 47 01 01 11 82 c9 f2 bb 58 4c 80 e6 dd 8e e6 d4 63 6d 25 85 48 93 24 0c 5c 89 12 40 0a 45 1b de 32 6e 91 d2 f4 8e a8 ea 64 06 40 68 5b b5 8b
0000353 22 7b 88 4a 52 b6 12 48 a4 79 47 01 9b 58 ec 4f 22 90 0a b9 5c 30 0f 44 91 26 3a 4d 8c b2 6c 65 9d e1 de 0c 84 c8 56 a2 e1 94 13 98 27 46 a5
0000432 0a 0e a5 3c c3 65 06 b6 9b 47 64 b0 80 88 8d 3a cc b4 24 a2 51 d5 ef 6a 07 7b 50 3e 24 e2 41 24 12 45 61 4f 4d 1c 62 18 3c 0f 2a 37 1e c8 c0
0000511 c9 82 3b 56 af 68 ee 48 a4 ac 77 34 49 59 20 90 75 a9 1c 81 48 e4 0b 89 38 91 59 d5 9d 2e 34 c8 4d 26 25 2d 68 95 a4 b3 4a 6b 35 58 6a 46 ac
0000570 47 01 01 12 8d cb 02 65 a9 1c 8d 08 2e 09 20 1d 6a 3f 30 51 f9 82 e2 4e 24 77 77 77 52 94 a2 d3 66 19 71 95 35 70 08 79 16 6d 18 04 b2 d9 b2
0000647 79 b2 8a 25 d4 e1 1c 06 62 82 42 f6 8f cc 14 7e 60 b8 93 89 20 82 08 16 35 8c b4 5a 84 a1 13 dd 51 48 2e 47 2d 32 89 24 d6 e7 73 b9 34 9a 92
0000726 48 d0 94 24 80 41 d6 a3 f3 05 1f 98 2e 24 e2 4a 08 80 a3 00 ca 6e 32 ab 4a f4 55 05 95 3e 8d a8 c3 41 5b 24 ae 55 a3 4d a6 9c d6 60 5c 15 24
0001005 a4 75 78 fc c1 47 e6 0b 89 38 92 8d b1 19 5a 42 5c 6d c8 69 c7 01 0b 8a 26 e5 6e b2 71 16 45 1a ae cb 0a 44 ab 53 8c a6 30 92 28 ab c6 3f 30
0001064 47 01 01 13 51 f9 82 e2 4e 24 d6 5b 69 53 d0 08 9c 29 88 71 c5 60 3d 08 c4 d9 34 a6 1a 8d 66 de b5 44 12 46 47 2c 32 d6 32 51 26 3a ff fd a4
0001143 04 66 43 33 44 33 44 44 22 33 33 43 6d b6 e4 6c 90 00 00 00 00 00 00 aa aa aa aa ea 2a aa aa a7 5d 30 cd b5 db 7e 36 d7 5c f3 d3 4d b7 d7 4d
0001222 78 cf 6d 35 db 3c f4 d7 4d 6f bf 0c 23 f3 05 1f 98 2f 19 3c 49 0c d0 80 a9 a2 6c 06 dc 45 34 0d 4a d8 b1 8c cb 28 4c 47 54 c9 73 4a d4 4b 42
0001301 45 aa 56 06 34 4a 43 59 8f cc 14 7e 60 bc 64 f1 23 ba 3a 89 5c fd 49 1b 6e c4 24 ae b4 49 43 4a f4 82 41 25 0f 66 b5 bb 49 4d 2d 5d 88 be 17
ES
Code:
#: od -t x1 --width=32 testcard_APID=0x0101_4ts.es
0000000 ff fd a4 04 66 33 33 44 33 44 44 22 33 33 33 6d b6 e4 6c 90 00 00 00 00 00 00 ff 0a aa aa ab ea
0000040 be aa a8 dd 8d d9 0c 90 c8 9d da 27 76 d7 5d b6 d7 4d 74 d3 5d 36 d7 ad ba d3 6d b5 cf 5c b9 d3
0000100 4d 34 be fc 30 7e f9 f3 f7 cf 5d dd dd dd dd dd db d5 b1 b6 e4 9c 61 73 05 12 4a 9a 36 9b 65 b1
0000140 24 ae 46 63 4d b2 e1 57 38 da 23 dd a2 91 b5 df 3d 7c f9 eb e7 77 77 77 77 77 74 19 10 65 26 67
0000200 c8 89 12 44 9c b9 4d 36 9a 69 2b 74 93 4b 25 28 94 36 cd c4 69 11 45 12 a3 a7 cf dd 3e 7e e9 de
0000240 5d e1 dd dd dc be 55 c3 82 c9 f2 bb 58 4c 80 e6 dd 8e e6 d4 63 6d 25 85 48 93 24 0c 5c 89 12 40
0000300 0a 45 1b de 32 6e 91 d2 f4 8e a8 ea 64 06 40 68 5b b5 8b 22 7b 88 4a 52 b6 12 48 a4 79 47 01 9b
0000340 58 ec 4f 22 90 0a b9 5c 30 0f 44 91 26 3a 4d 8c b2 6c 65 9d e1 de 0c 84 c8 56 a2 e1 94 13 98 27
0000400 46 a5 0a 0e a5 3c c3 65 06 b6 9b 47 64 b0 80 88 8d 3a cc b4 24 a2 51 d5 ef 6a 07 7b 50 3e 24 e2
0000440 41 24 12 45 61 4f 4d 1c 62 18 3c 0f 2a 37 1e c8 c0 c9 82 3b 56 af 68 ee 48 a4 ac 77 34 49 59 20
0000500 90 75 a9 1c 81 48 e4 0b 89 38 91 59 d5 9d 2e 34 c8 4d 26 25 2d 68 95 a4 b3 4a 6b 35 58 6a 46 ac
0000540 8d cb 02 65 a9 1c 8d 08 2e 09 20 1d 6a 3f 30 51 f9 82 e2 4e 24 77 77 77 52 94 a2 d3 66 19 71 95
0000600 35 70 08 79 16 6d 18 04 b2 d9 b2 79 b2 8a 25 d4 e1 1c 06 62 82 42 f6 8f cc 14 7e 60 b8 93 89 20
0000640 82 08 16 35 8c b4 5a 84 a1 13 dd 51 48 2e 47 2d 32 89 24 d6 e7 73 b9 34 9a 92 48 d0 94 24 80 41
0000700 d6 a3 f3 05 1f 98 2e 24 e2 4a 08 80 a3 00 ca 6e 32 ab 4a f4 55 05 95 3e 8d a8 c3 41 5b 24 ae 55
0000740 a3 4d a6 9c d6 60 5c 15 24 a4 75 78 fc c1 47 e6 0b 89 38 92 8d b1 19 5a 42 5c 6d c8 69 c7 01 0b
0001000 8a 26 e5 6e b2 71 16 45 1a ae cb 0a 44 ab 53 8c a6 30 92 28 ab c6 3f 30 51 f9 82 e2 4e 24 d6 5b
0001040 69 53 d0 08 9c 29 88 71 c5 60 3d 08 c4 d9 34 a6 1a 8d 66 de b5 44 12 46 47 2c 32 d6 32 51 26 3a
0001100 ff fd a4 04 66 43 33 44 33 44 44 22 33 33 43 6d b6 e4 6c 90 00 00 00 00 00 00 aa aa aa aa ea 2a
0001140 aa aa a7 5d 30 cd b5 db 7e 36 d7 5c f3 d3 4d b7 d7 4d 78 cf 6d 35 db 3c f4 d7 4d 6f bf 0c 23 f3
0001200 05 1f 98 2f 19 3c 49 0c d0 80 a9 a2 6c 06 dc 45 34 0d 4a d8 b1 8c cb 28 4c 47 54 c9 73 4a d4 4b
0001240 42 45 aa 56 06 34 4a 43 59 8f cc 14 7e 60 bc 64 f1 23 ba 3a 89 5c fd 49 1b 6e c4 24 ae b4 49 43
0001300 4a f4 82 41 25 0f 66 b5 bb 49 4d 2d 5d 88 be 17
Lets see if ts play
Code:
#: ffplay -autoexit testcard_APID=0x0101_4ts.ts
Lets see if es play
Code:
#: ffplay -autoexit testcard_APID=0x0101_4ts.es
And both do as expected. Do not put to much effort on ES. This is just to show how TS is pack. As you can see 4 TS where needed to pack 1 ES.

Last edited by cayoenrique; 01-07-2021 at 14:22..
Reply With Quote
The Following 11 Users Say Thank You to cayoenrique For This Useful Post:
Asaawe (03-07-2021), draculasat (23-07-2021), dvlajkovic (02-07-2021), iq180 (03-07-2021), localhosthack0r (11-07-2021), manic01 (03-07-2021), ro_54 (01-07-2021), Stunner34 (03-07-2021), ViaHussun (03-07-2021), voomvoom (16-07-2021), x 1 (03-07-2021)
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:57.


Powered by vBulletin
Copyright ©2006-2019 - Sat Universe