Silk Road forums

Support => Technical support => Topic started by: hatedpatriot on April 08, 2012, 07:35 am

Title: Linux users, let's do this
Post by: hatedpatriot on April 08, 2012, 07:35 am
I'm not  a huge fan of Ubuntu, but I'm using it for the moment. It seems they broke seahorse-plugins in the version of gnome I have. I don't have the bandwidth or desire to uprgrade my entire system just to gain right click encrypt functionality. I was wondering if we could work together on a small script that would encrypt our order forms. I will start anyway since the command line is the only way I can encrypt anything right now. It doesn't need to be a powerhouse of functionality either, a simple little script should do nicely, but if several of us work with it we can make something nice.

Here's all I'm going for in my little version. Something like
Code: [Select]
SilkRoad -u tony76This would encrypt a text file with my desired shipping address using the public key I had for user tony76. Mine may require a bit of extra work since I have many addresses I can use. I'm not great at scripting, but I can usually get what I need done, it may be ugly and funny to a real programmer, but it'll still work.

Anyone interested in working on something like this?

PS; Are there any agreed upon standards that I should be aware of for how we encrypt to each other, or can I just use a vanilla
Code: [Select]
gpg --default-key type line with no extra parameters passed? I hate command line encryption, but I'm stuck with it.
Title: Re: Linux users, let's do this
Post by: hatedpatriot on April 08, 2012, 05:22 pm
Okay, I got something that works pretty good, though I will be working on it more. I made a launcher with a SilkRoad icon, but for some reason it does not put the finished message on the clipboard like it should. When you invoke the script from an already established terminal it works perfectly, though. You just create a hidden file called .address, this is just plain text that has your address you are having shit sent to. I will be making that part better soon. Anyway, you invoke the script by doing a
Code: [Select]
./SilkRoad.sh. It will then list all available keys on your system and ask which recipient. You type in the recipient (username only) then hit enter. It then asks if you'd like to add a message. If you say yes it allows you to do that, if not it goes to the next step, the encryption. After it encrypts the data it automatically puts it in your clipboard so you only have to go to the SilkRoag order page then and paste.

Don't laugh at my code, I'm not a coder, but it fucking works.
Code: [Select]
#!/bin/bash
# Remove any old instances that may be laying around
rm .address.tmp* 2>/dev/null
# Make a new temp one
cp .address .address.tmp
# List all available keys
echo Available keys
echo --------------------
gpg --list-keys|grep uid
echo --------------------
echo -e "Which recipient? (Username only not email address) \c"
read user
read -p "Add message with address (y/n)?"
if [ $REPLY = "y" ]; then
read -p "Type message then hit enter: `echo $'\n>'`" msg
echo "$msg">>.address.tmp
fi
gpg -r $user -a -e .address.tmp
mv .address.tmp.asc .address.tmp.txt
xsel --clipboard < .address.tmp.txt
rm .address.tmp.txt

Title: Re: Linux users, let's do this
Post by: oret on April 10, 2012, 01:45 am
I just use
Code: [Select]
gpg --import to import SR keys and
Code: [Select]
gpg -e -r "VENDOR" --armor to encrypt messages / my address. Pretty easy if you remember 'e' for encrypt, 'r' for recipient, and 'armor' = text (instead of a binary blob).
Title: Re: Linux users, let's do this
Post by: ThePotDoctor on April 10, 2012, 01:17 pm
gpg --import
gpg -e -r [vendor] -a

When I was using command-line that is.

or does anyone even use the gedit GPG plugins? They make it 100x simpler.