How can I decrypt a PGP Self Decrypting Archive programatically? [closed] - encryption

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Everyday I receive SDA files for whom I have the passphrase. The decryption is done by running the file and manually entering a passphrase in the program window that pops up. I'd like to avoid this manual step, and turn it into a step of an automated process.
The way this would work is the following:
As soon as my daemon detects that a new file has arrived to my inbox, my program would download, decrypt and save it. I know how to do all these with code, except the decryption part.
Instead of running the .exe file, and manually entering the passphrase, I want to read it's contents, and with the passphrase, decrypt the data contained within it, which looks like this:
4d5a 9000 0300 0000 0400 0000 ffff 0000
b800 0000 0000 0000 4000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 f000 0000
0e1f ba0e 00b4 09cd 21b8 014c cd21 5468
...etc
The language I'm currently using is PHP, but taking a look at an implementation in any language will help.
Any ideas?

PGP self-decrypting archives is just EXE stub + PGP message inside of this file. You should parse EXE headers, and found where this data is stored, extract it, and decrypt using GnuPG or any other PGP library.

Related

Can I buy a single MAC address for a computer project?

So, I'm currently building an 8-Bit computer, and working on getting it connected to the internet, clearly just on a simple LAN to start off, in the hope of making ARP requests and such like which would be pretty cool.
I have had a little look around and I can only find standards companies selling MAC address by the million, this wont work for me.
Does anyone know how someone can accquire a single MAC address for personal use, not making money from it, but registered non the less.
Cheers all!
Well one idea is that Microchip sells small EEPROM memory chips preprogrammed with a MAC address. One example of this is the AT24MAC602. It also contains a unique read-only 128-bit serial number and 2Kb (256 bytes) of user-accessible serial EEPROM NVM storage.
One way to use this would be to incorporate the chip into your design. Another would be to read out the MAC with an appropriate reader and hard code the address into your project.

How to set template in GT-521F32 fingerprint scanner? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I'm working on a project using the GT-521F32 fingerprint scanner, i want to store the templates in a database in my computer rather than have them stay in the fingerprint scanner's memory. While I am able to get the templates from the fingerprint scanner and store it in my computer, I am unable to set the templates back to the fingerprint scanner. I am currently using RealTerm to send commands to the fingerprint scanner.
First, I would get the template from ID 1
Send command (Get template from ID 1):
0x55 0xAA 0x01 0x00 0x01 0x00 0x00 0x00 0x70 0x00 0x71 0x01
Output:
55 AA 01 00 00 00 00 00 30 00 30 01 (Acknowledge)
5A A5 01 00 ...(498 bytes of template data)... FD DF (Data Packet)
I would then delete the template in ID 1, and set the template that I got from ID 1 in ID 2
Send Command (Set template to ID 2):
0x55 0xAA 0x01 0x00 0x02 0x00 0x00 0x00 0x71 0x00 0x73 0x01
Output:
55 AA 01 00 00 00 00 00 30 00 30 01 (Acknowledge)
Send Command (Data packet):
0x5A 0xA5 0x01 0x00 ...(former ID 1 template data)... 0xFD 0xDF
Doing this doesn't result in an acknowledgement packet
Even when using the demo program provided, when I use the setTemplate option, it just results with "Communication error". How do I set templates from my computer to the fingerprint scanner's memory?
I have experienced the same issue with UART interface. Switching to the onboard USB interface (J1 pads on the bottom of the PCB) will eliminate the error message but you would need to use USB Mass Storage interface instead of UART which is not ideal.

Controlling projector with serial port

I've been trying to control Panasonic PT AE3000U through computer serial port for a last few days. Computer that I am using has serial port on its back, and I've confirmed that port functions at some level by connecting RXD and TXD with jump wire.
Technical information about projector (10Mb): http://www.projectorcentral.com/pdf/projector_manual_4506.pdf
Section that tells about serial communications starts from page 51.
According to manual and that what I've read from online, start-up command in hex should be 02 50 4f 4e 03, but I haven't been able to get it work with that.
Variations of that command I've tried to send with RealTerm and Termite:
02 50 4f 4e 03
02504f4e03
0x02 0x50 0x4f 0x4e 0x03
0x020x500x4f0x4e0x03
And other similar combinations and formats
I assume that command on third row should be the right one, because if I send that as numbers with Realterm, and connect RDX and TXD together similarly as I did before, I get this on screen (display settings are "display as ascii").
http://i.imgur.com/PjpRms7.png
But when I connect cable to the projector and repeat the process, nothing happens. Baudrate is set at 9600, which should be correct.
So, I guess it somehow solved itself. I decided to restart my computer and projector. "Just in case there would be something left from all of mine failed attempts"
And it started to work, I sent line 0x02 0x50 0x4f 0x4e 0x03 with Realterm as numbers only.
My settings were:
Baudrate 9600
Parity: None
Data bits: 8
Stop bits: 1

use serialforwarder data in another program

how can i build the serialforwarder or use it to forward the received data to another program to make some process?
how to parse the data and use it as input data to another program such as Matlab or c# or java application.
which protocol used to parse the recieved data ?
last question: it is just for motes which is base station mote ? can i build one for any mote ?
You have to read thoroughly the serial stack...its not very easy but its do able.
You can directly read from serial port. You don't need serial forwarder in this case. There are few things to take care of.
For example if you want to read a serial message that is being send to serial port of your PC (usb sensorboards just work like serial, since they are using usb to serial converters lik FTDI chip).
in C# (same for Java, etc...) you can read byte streams that are coming in the serial port. You can parse this byte streams to extract a standard serial message of tinyos.
This is somehow explained in TEP #113 although it has some problems, but you should be able to find those problems and make your program work.
As it stated in TEP 113, a standard serial packet is something like:
7e 40 09 00 be ef 05 7d 5d 06 01 02 03 04 05 7e
That means, a packet starts with hex 7E ( I believe its 126 or 127) and ends also with 7E. The last 2 bytes are CRC of the packet. So you can in your c# program start reading from serial port when you encounter 7E and stop reading when you reach the next 7E in the stream. Everything in between will be your packet.
You have to be careful of escaping that is if a 7E is part of your packet content, to be not be confused with start and end dilimeters, it will be escaped to something else...that's also is explained in that TEP 113.
I believe there were some C++ code fro calculating the CRC that you can easily convert it to C# or Java code.
Also check the source code of Serial.h which contains some details about how a serial packet is being formed in TinyOS.

www.baidu.com can be visited but unable to be ping or tracert [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
My computer is in intranet. I can visit www.baidu.com , see
But it is unable to ping or tracert , see
Could anyone explain why ?
Many ISPs filter out ICMP (which is what ping/tracert on windows uses). It can also be that your router #home does only partial NAT of your connections and only allows some standard user protocols like HTTP/FTP/whatnot.
There's nothing to be alarmed of really, it's fairly normal, so unless you have a particular reason you want this to work - it should have no impact on your browsing experience.
They (or your intranet or someone in between) could block ping messages and still serve HTTP.
FWIW I can ping them just fine (but the IP address is different):
$ ping www.baidu.com
PING www.a.shifen.com (119.75.217.56): 56 data bytes
64 bytes from 119.75.217.56: icmp_seq=0 ttl=55 time=28.041 ms
64 bytes from 119.75.217.56: icmp_seq=1 ttl=55 time=29.468 ms
64 bytes from 119.75.217.56: icmp_seq=2 ttl=55 time=26.807 ms

Resources