OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/string_util.h" |
| 6 #include "chrome/browser/password_manager/encryptor.h" |
| 7 #include "chrome/browser/password_manager/login_database.h" |
| 8 |
| 9 std::string LoginDatabase::EncryptedString(const string16& plain_text) |
| 10 const { |
| 11 std::string cipher_text; |
| 12 if (!Encryptor::EncryptString16(plain_text, &cipher_text)) |
| 13 NOTREACHED() << "Failed to encrypt string"; |
| 14 return cipher_text; |
| 15 } |
| 16 |
| 17 string16 LoginDatabase::DecryptedString(const std::string& cipher_text) |
| 18 const { |
| 19 string16 plain_text; |
| 20 if (!Encryptor::DecryptString16(cipher_text, &plain_text)) |
| 21 NOTREACHED() << "Failed to decrypt string"; |
| 22 return plain_text; |
| 23 } |
OLD | NEW |