Pages

Showing posts with label Software. Show all posts
Showing posts with label Software. Show all posts

2013-06-23

Hashcash for Gmail


For more information about Hashcash, please see http://www.hashcash.org/

For issues see here.

Privacy Policy: This app uses GMail App APIs to access to your gmail inbox, to tag, filter and re-file emails. It does not store or save any personal information, nor send any info to external sources.

Terms of Service: This app offers NO WARRANTY or GUARANTEE OF FITNESS. USE AT OWN RISK. The author assumes NO responsibility for any effects, intentional or otherwise, on contents of your gmail inbox.

This page is for information on my experimental HashCash for GMail -- a combination of a Chrome extension (or google gadget plugin for gmail, blogspot or any other OAuth gadget hosting page) that generates Hashcash stamps for inclusion into emails you send. For maximum usefulness it should be paired with my nearly-ready google app script (which will also be published as a Chrome App) that scans incoming gmail messages and flags them accordingly by detecting these stamps.

The solution consists of two parts:
  • The Hashcash Mint Chrome extension/google-gadget, which lets one generate a valid hashcash stamp from within the gmail web interface or from anywhere while running Chrome; and
  • The Hashcash for Gmail google app script, which runs periodically on your gmail inbox to scan for valid hashcash stamps and flag the emails accordingly.
Some readers may say: 'Doesn't gmail do an awesome job of detecting spam already? I used to think so, but their filters really started breaking down for me a few months ago. If someone can explain why that may be occurring, I'd appreciate an explanation. I'm sick of spam.

1. Installing the Hashcash Mint Google Gadget

1a. For Non-Chrome Browsers [Firefox etc.]
  • Enable 'Labs' in your gmail account (Gear icon->Settings->Labs) if it isn't already;
  • Enable the 'Add any gadget by URL' feature;
  • Add the Hashcash Mint gadget (url: http://www.blitter.com/~russtopia/googlegadgets/hcgen.xml)
You may have to reload gmail to see the gadget appear in your sidebar on the left. Google talk may mask the google gadgets area; in that case click on the ellipsis button at bottom left to switch to google gadget view.

1b. For Chrome Browsers


After clicking 'Mint' and the Hashcash stamp has been generated, you just hit CTRL-V in an email while composing to paste the just-generated stamp (the extension has the 'copy-to-clipboard' permission so it should do the 'copy' CTRL-C for you.)

2. Installing the Hashcash for Gmail App Script

2a. For Non-Chrome Browsers [Firefox etc.]
 
 You likely require a Google account for this, but since this is intended for gmail you already have that, right? :)

2b. For Chrome users: Installing the Hashcash for Gmail App


Hashcash is an idea that really should have taken off by now.. but email servers and clients have never seemed willing to agree to implement it, which is a shame as it really could make spam nearly disappear -- if enough people would just use it!

So I hope to make this as easy to use as possible -- if you like it, please tell those you know to try using it too. If you're someone who knows how to write Outlook, Thunderbird or other email plugins, consider writing an equivalent to my Hashcash for Gmail inbox scanner for those mail hosts, so others can easily start using Hashcash!



Hashcash for Gmail -Support & Issues


Version 4 [2013-11-27]:


Issue

There appears to be a bug in the auto-registration of the timed trigger in the mail scanner. The trigger is supposed to run once a minute to scan for incoming mail with hashcash stamps.


Solution

  • Open chrome://apps and click on the "Hashcash for Gmail" icon;
  • Click on the "Disable" button which should change to "Enable";
  • Click on "Enable" again and it should change to "Disable"
  • Close the app.

The per-minute trigger should now be active and emails recently placed in your Inbox will be scanned and tagged accordingly.

2011-11-19

A Dual-Rate UART Implemented in Software Using Atmel ATTiny MCUs

I've started designing a wireless interface using Bluetooth that, for technical reasons, requires the endpoints to communicate at a nonstandard baud rate. I found these neat-o Bluetooth-to-serial adapters on the net [look around, this is not the cheapest place, don't pay more than $8 USD or so for them and be sure to verify they have the HC-03 or HC-05 firmware that supports master -and- slave modes] that have a convenient AT-command set interface for configuration, so you can pair them up without any in-depth knowledge of Bluetooth, and a transparent mode that then acts like the modems of old... but they only support the standard rates you see with COM ports on PCs (9600/19200/38400 and so on). Bummer.

So.. it seemed to me that it should be possible to add a controller that, depending on the communication direction (this is a unidirectional link), would do an up- or down-conversion by sitting in between the BT interface and the target endpoint.

No hardware UART I've heard of supports a split data rate on the Tx and Rx lines, so a hardware UART or USART was not in the running. Software UART implementations from Atmel's app notes only do half-duplex while this required something that could shuffle data both ways in order to do the rate conversion.

For full-duplex software UARTs there is a handy library out there which includes one -- the Procyon AVRlib -- but it was written for AVR mega MCUs, and didn't have any facility for asymmetric baud rates. My application only needed a few pins so I wanted to use the ATTiny which has a somewhat different interrupt and timer register set as compared to the ATmega series. Moreover, the ATTiny25/45/85 have two independent hardware timers -- it looked perfectly feasible to implement a software UART that had asymmetric baud rates on the Tx and Rx sides, so why not roll my own software UART. Shouldn't be too hard, right?

Here's the general concept:

[A]----low-rate---->|SW-UART-Rx|---->|SW-UART-Tx|----high-rate---->|BT Master| >>>

and (for the other side)

>>> |BT Slave|----high-rate---->|SW-UART-Rx|---->|SW-UART-Tx|----low-rate---->[B]

As long as your endpoints [A] and [B] use a lower bitrate than whatever the Bluetooth-to-serial modules are configured for while in transparent mode, no special buffering of serial data should be required as [A] and [B] limit the total end-to-end bitrate to that of [A] and [B] themselves.

It took a bit of head-scratching with the oscilloscope attached but I managed to get a full-duplex software UART going on the ATTiny85, with no external hardware required. Symmetric or dual-bitrates are supported. I've tested the symmetric config at 38400 using puTTY and a USB-to-serial interface and all looks good so far. No real reason why the split rate shouldn't work, as each of Tx and Rx use their own unique timer...


I'll post code as soon as I have a spare moment.. gotta eat lunch now :p

[Update] Download source: attinyx5-dual-rate-swuart.zip