1c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// 2c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// Copyright (C) 2011 The Android Open Source Project 3c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// 4c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// Licensed under the Apache License, Version 2.0 (the "License"); 5c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// you may not use this file except in compliance with the License. 6c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// You may obtain a copy of the License at 7c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// 8c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// http://www.apache.org/licenses/LICENSE-2.0 9c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// 10c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// Unless required by applicable law or agreed to in writing, software 11c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// distributed under the License is distributed on an "AS IS" BASIS, 12c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// See the License for the specific language governing permissions and 14c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// limitations under the License. 15c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// 16877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov 17c45688bb3881f0c2216e6ec0e19ebda0be33e871Ben Chan#ifndef SHILL_CRYPTO_ROT47_H_ 18c45688bb3881f0c2216e6ec0e19ebda0be33e871Ben Chan#define SHILL_CRYPTO_ROT47_H_ 19877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov 208a5322984f2d81bcbfd8d44c59747a11bd9b904bAlex Vakulenko#include <string> 218a5322984f2d81bcbfd8d44c59747a11bd9b904bAlex Vakulenko 22cc67c52a2c00f90e877971d552208dd99825d84eBen Chan#include <base/macros.h> 2386964e0bae1a38c6817243959026603b4b8c69b7Darin Petkov 24877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov#include "shill/crypto_interface.h" 25877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov 26877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkovnamespace shill { 27877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov 28877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov// ROT47 crypto module implementation. 29877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkovclass CryptoROT47 : public CryptoInterface { 30877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov public: 31877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov static const char kID[]; 32877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov 3386964e0bae1a38c6817243959026603b4b8c69b7Darin Petkov CryptoROT47(); 3486964e0bae1a38c6817243959026603b4b8c69b7Darin Petkov 35877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov // Inherited from CryptoInterface. 36877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov virtual std::string GetID(); 37a794cd60a7339d576ea2eed263a4f0a20fb255afPaul Stewart virtual bool Encrypt(const std::string& plaintext, std::string* ciphertext); 38a794cd60a7339d576ea2eed263a4f0a20fb255afPaul Stewart virtual bool Decrypt(const std::string& ciphertext, std::string* plaintext); 3986964e0bae1a38c6817243959026603b4b8c69b7Darin Petkov 4086964e0bae1a38c6817243959026603b4b8c69b7Darin Petkov private: 4186964e0bae1a38c6817243959026603b4b8c69b7Darin Petkov DISALLOW_COPY_AND_ASSIGN(CryptoROT47); 42877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov}; 43877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov 44877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov} // namespace shill 45877642b0c9e2416f69a2f76b26539f30ef98d43cDarin Petkov 46c45688bb3881f0c2216e6ec0e19ebda0be33e871Ben Chan#endif // SHILL_CRYPTO_ROT47_H_ 47