LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create a digital signature on a TCP or a UDP flow?

I am trying to convert samples of a voice signal, which is intercepted from the microphone, into fixed length digital signature bytes (using Hash, or) and attach these fixed length bytes to a communication session between two terminals (UDP or TCP "HTTP"). The other receving end should be able to identify the person at the sending side.

 

Any thoughts how I could do this?

 

Any help is most appreciated.

 

Sam

0 Kudos
Message 1 of 8
(5,011 Views)

Sam,

 

There are a number of ways in which you could theoretically do this.  I would start with looking at the TCP or UDP examples in the NI Example Finder.  Also, you didn't mention which version of LabVIEW you are using.

 

As far as the encryption, that would be entirely up to you and how secure you are wanting to be with the algorithm.  I'd recommend getting some 2-way communication working with the examples first and then increase the complexity step-by-step.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
Message 2 of 8
(4,975 Views)

Thanks Jared for the reply. I am using LabView version 8.5. I am not using any encryption. PC 1 and PC 2 are in a constant UDP and/or TCP connection (i.e., HTTP, etc). The program should capture the sender's voice ad create a fixed length HASH (digital signature) from it based on its unique characterstics (probably FFT characterstics). Then the program will add these HASH bytes to the main UDP/TCP streams. These streams are sent in the clear. At the receiving end (PC2), these UDP/TCP bytes are received and the HASH bytes are extracted and the identity of the sender will be determined.

 

In this example the actual voice samples are not sent, only the digest of some of the packets, therefore no voice recogination is used. No encryption is used either.

 

The program consists a voice sampler that samples voice of 4-5 people and finds the FFT and stores these information in a table. Then captures the sender's voice and create a digital signature and attach them to the steady TCP/UDP flow and the rest has been explained above.

 

I appreciate any useful information.

 

Thanks

 

Sam

0 Kudos
Message 3 of 8
(4,968 Views)

Sam,

 

It sounds like you have outlined all that you are wanting to do, excellent.  Where along this process are you running into problems?  What have you accomplished thus far?

 

Additionally, what do you mean by 'Steady Flow' for the TCP/UDP connection?  Are you constantly sending data, or just sending data once someone's voice has been converted to the digital signature via FFT?

 

What you'll probably want to do is test your connection with some basic TCP or UDP transfer VIs (as found in the example finder).

 

Then you'll work on getting your voice data converted to the digital signature and stored in a table (array).

 

Once you have the digital signature, you would use this in your TCP or UDP write command and then receive it on the other end.

 

At the receiving end you'd compare the data with the data in your stored table.

 

That is one method that would probably accomplish the task you are wanting.  I'm sure that you understand your equipment, network, and the problem description a bit better so you'll want to take from this what you can and apply your own methods to accomplish your task.

 

Again, if you have any questions in specific, I'm more than happy to help.  It would be helpful to see what you have so far and what you are expecting with some VIs that you post so myself and others can get a better feel for your end-goal.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
Message 4 of 8
(4,942 Views)

Jared,

 

On paper I have every figured out, however I need help for implementation. I am in the starting point for implementation.In particular I need access to the following basic projects::

 

  1. VI project that samples the voice received from the MIC and stores the sampled (i.e., WAV format) in a file
  2. VI project that woud take the WAV file and perform FFT calculation and stores the results in another file. Eventually I will create a fixed length data from each file, which is the ID of the speaker
  3. VI project that would take the creates a digital signature from the ID created in step 2 using one of the famous schemes (i.e., DSA). By the way what are the currently implemented digital signature schemes in LabView?
  4. VI project that takes the digital signature and adds these signature as payloads for UDP/TCP packets. Then sends these UDP/TCP packets from one PC (IP Address A) through Wi-Fi connection to another PC (IP Address B), which is on the same subnet as PC A
  5. VI project that would take the received packets from PC B and extract the digital signature
  6. VI project that would derive the ID from the extracted digital signature and compares the result to a table with all the people's ID for matchng.
  7. The progam should be able to create various graphes related to throughput, delay, ...of these packets

Please let me where I can find these projects.

 

Thanks

 

Sam

0 Kudos
Message 5 of 8
(4,927 Views)

Sam,

 

If you have the Sound and Vibration toolkit it may make some things easier for you regarding the voice-recording aspect, but if you aren't recording and playing back the actual sounds, just using this for detection and digital signatures, you shouldn't need to worry about this.

 

1. For this you are going to be doing some form of Analog Input.  Then you will be storing this data to a file.  There are examples for both of these aspects in the NI Example Finder from within LabVIEW.

2. If you are going to be doing the FFT, there is a VI under the Mathematics Palette that performs this operation.  Again you can use the same example for saving data to the file.

3. You would need to figure out what needs to be done to create a digital signature for this.  There may be something in the Sound and Vibration toolkit for this, but I do not know.

4. For the UDP or TCP transfers, there are several examples for doing this and they cover how to create the connection and transfer / receive data.  These too are in the NI Example Finder

5. This goes back to number 4, this would indeed be a separate program, but everything else would just be one project and one program.  

6. This would depend on how the ID was created in step 3, again whether you do the algorithm on yourself or not.  For comparing to the table, you would use a Search Array and some comparison functions, all depending on how you stored the data initially.

7. Graphs are all available on your Front Panel of your VIs and you would just wire up the data that you'd like and have it displayed on the graph.

 

There will not be an example for everything that you are wanting to do.  The examples are meant to help you get started.  Have you used LabVIEW before?  I would recommend doing the 3 Hour LabVIEW Introduction Course to help you get started.  This will cover some of the basic concepts that you will need to know in order to create your application.

 

Unfortunately I cannot write the code for you, only guide and direct you.  LabVIEW is a programming language and does require the user to lay out and create their own program.  You will not be able to just find three or four pre-built code-snippets and connect them together to get your appliction working the way you want it.  You will need to develop the applications yourself.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
0 Kudos
Message 6 of 8
(4,897 Views)

Jared,

Is there a way to send a byte stream in UDP ??  The UDP examples only show strings ( ascii).

0 Kudos
Message 7 of 8
(4,752 Views)
ASCII is a byte stream.  You can use the typecasting functions to convert from byte arrays to strings.
0 Kudos
Message 8 of 8
(4,747 Views)