uint32_t encrypt_with_mode(const BYTE *password, const BYTE* data, uint32_t len, BYTE* ans, encrypt_mode mode, encrypt_method method) { uint32_t outl; switch (mode) { case AES128: outl = encrypt_aes128(password, data, len, ans, method); break; case AES192: outl = encrypt_aes192(password, data, len, ans, method); break; case AES256: outl = encrypt_aes256(password, data, len, ans, method); break; case DES: outl = encrypt_des(password, data, len, ans, method); break; } return outl; }
bool msl::encrypt_aes256(const std::string& plain,const std::string& key,const std::string& iv,std::string& cipher) { return encrypt_aes256(plain.c_str(),plain.size(),key,iv,cipher); }