The S3 web service (http://www.amazon.com/s3) costs $0.15 per month per GB of storage, and $0.20 per GB of data transferred. If you already have an Amazon account, your existing account is billed. The price is reasonable; so far I've run up a $0.03 bill. All calls to S3 go over an encrypted SSL connection (although you can use a nonSSL connection for debugging or troubleshooting). When signing up for S3, you are assigned an Access Key ID that identifies you in every S3 call. Your Access Key ID is not secret. You are also given a Secret Access Key that creates a signature that authenticates you.
S3 organizes data in "buckets" that are similar to disk folders. Although individual S3 users can have no more than 100 buckets, each bucket can hold an unlimited number of objects. Unlike disk folders, buckets cannot contain other bucketsjust objects. Objects are blobs of data from 1 byte to 5 GB. Each object in a given bucket is identified by a unique key. Although my sample app only grants you access to the objects it stores, the S3 API lets you grant access to other users via access-control lists. See S3DataTransfer.AccessControlList in the sample app source code for an example of an access-control list. You can grant yourself access to an object with an access-control list containing either the e-mail address you use for your Amazon account, or your Canonical User ID. I use my Canonical User ID because my e-mail address doesn't work (because my Amazon account somehow ended up with multiple passwords). You can determine your Canonical User ID and display name by calling the ListAllMyBuckets method and inspecting the Owner.ID and Owner.DisplayName properties in the response object. That's how the Options/Settings dialog box does it.
To use S3 in a Visual Studio 2005 application, add a web reference to http://s3.amazonaws.com/doc/2006-03-01/AmazonS3.wsdl. Download the "Amazon S3 Library for SOAP" in C# from Amazon's S3 Resource Center. Add the AWSAuthConnection.cs and AWSDateConnection.cs files to your project. You'll need to add a using statement to the AWSAuthConnection.cs file that points to the web service proxy that you created when you added the web reference. See the sample app's version of AWSAuthConnection.cs for an example of this. Synchronize Files uses the AWSAuthConnection class to make all of its S3 calls because it takes care of all the security details.
Reading through the S3DataTransfer source code, you notice a few S3 API quirks. Currently the AWSAuthConnection.createBucket method always returns a null response object, even when it successfully creates the bucket. That's why S3DataTransfer.CreateBucket calls S3DataTransfer.BucketExists to determine if the bucket was created. Another quirk is that AWSAuthConnection.put stores a string, but AWSAuthConnection.get retrieves a byte array. To overcome this asymmetry, S3DataTransfer.UploadBuffer converts its byte array into a string using UTF8Encoding.GetString. When that byte array is subsequently retrieved using AWSAuthConnection.get in S3DataTransfer.DownloadBuffer, the byte array will be identical to the one previously stored.