private byte[] GetImageBytes(string encryptedFileName) { var filePath = baseFilePath + encryptedFileName; var encryptedFileContent = File.ReadAllText(filePath); // base64 encrypted string var decryptedContent = DataEncryptor.DecryptWithSalt(encryptedFileContent); // base64 decrypted string byte[] imageBytes = Convert.FromBase64String(decryptedContent); return(imageBytes); }