shill: Implement a rot47 crypto module.

This module is required for parity with flimflam and will be used to scramble
values in the perstistent store.

BUG=chromium-os:16964
TEST=unit test

Change-Id: I20de52eebfe6f9f5ccd4ddcb4c7e3e94edbb7af7
Reviewed-on: http://gerrit.chromium.org/gerrit/3258
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
diff --git a/crypto_interface.h b/crypto_interface.h
new file mode 100644
index 0000000..9bf1149
--- /dev/null
+++ b/crypto_interface.h
@@ -0,0 +1,31 @@
+// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SHILL_CRYPTO_INTERFACE_
+#define SHILL_CRYPTO_INTERFACE_
+
+#include <string>
+
+namespace shill {
+
+// An interface to an encryption/decryption module.
+class CryptoInterface {
+ public:
+  virtual ~CryptoInterface() {}
+
+  // Returns a unique identifier for this crypto module.
+  virtual std::string GetID() = 0;
+
+  // Encrypts |plaintext| into |ciphertext|. Returns true on success.
+  virtual bool Encrypt(const std::string &plaintext,
+                       std::string *ciphertext) = 0;
+
+  // Decrypts |ciphertext| into |plaintext|. Returns true on success.
+  virtual bool Decrypt(const std::string &ciphertext,
+                       std::string *plaintext) = 0;
+};
+
+}  // namespace shill
+
+#endif  // SHILL_CRYPTO_INTERFACE_