Ejemplo n.º 1
0
        protected void All_Admins_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Label  Student_Name = (Label)e.Row.FindControl("Student_Name");
                Label  Contact      = (Label)e.Row.FindControl("Contact");
                Label  Email        = (Label)e.Row.FindControl("Email");
                Label  Institute    = (Label)e.Row.FindControl("Institute");
                Button Chng_Status  = (Button)e.Row.FindControl("Change_Status");

                Student_Name.Text = DataBinder.Eval(e.Row.DataItem, "Name").ToString();
                Contact.Text      = secure.Decrypt(DataBinder.Eval(e.Row.DataItem, "Contact").ToString(), "TSIE-GEHM-TAKUCF");
                Email.Text        = secure.Decrypt(DataBinder.Eval(e.Row.DataItem, "Email").ToString(), "TSIE-GEHM-TAKUCF");
                Institute.Text    = DataBinder.Eval(e.Row.DataItem, "Institute").ToString();
                string chng_stts = DataBinder.Eval(e.Row.DataItem, "Status").ToString();
                Chng_Status.CommandArgument = DataBinder.Eval(e.Row.DataItem, "Admin_ID").ToString();
                Chng_Status.CommandName     = DataBinder.Eval(e.Row.DataItem, "Status").ToString();
                if (chng_stts == "1")
                {
                    Chng_Status.Text        = "Block";
                    Chng_Status.BackColor   = Color.Red;
                    Chng_Status.BorderColor = Color.Red;
                    Chng_Status.ForeColor   = Color.White;
                }
                else
                {
                    Chng_Status.Text        = "Unblock";
                    Chng_Status.BackColor   = Color.Green;
                    Chng_Status.BorderColor = Color.Green;
                    Chng_Status.ForeColor   = Color.White;
                }
            }
        }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Admin_ID() != "0")
     {
         Admin_Name_box.Text = find.Admin(Admin_ID()).Rows[0]["Name"].ToString();
         Contact.Text        = secure.Decrypt(find.Admin(Admin_ID()).Rows[0]["Contact"].ToString(), "TSIE-GEHM-TAKUCF");
         Email.Text          = secure.Decrypt(find.Admin(Admin_ID()).Rows[0]["Email"].ToString(), "TSIE-GEHM-TAKUCF");
         Institute.Text      = find.Admin(Admin_ID()).Rows[0]["Institute"].ToString();
         Institute.Enabled   = false;
     }
 }
        public string DecryptString(byte[] message)
        {
            byte[] data   = _crypt.Decrypt(message);
            string result = Encoding.UTF8.GetString(data);

            return(result);
        }
Ejemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Student_ID() != "0")
     {
         Student_Name_box.Text = find.Students(Student_ID()).Rows[0]["Name"].ToString();
         Father_Name_box.Text  = find.Students(Student_ID()).Rows[0]["Father_Name"].ToString();
         Contact.Text          = secure.Decrypt(find.Students(Student_ID()).Rows[0]["Contact"].ToString(), "TSIE-GEHM-TAKUCF");
         Email.Text            = secure.Decrypt(find.Students(Student_ID()).Rows[0]["Email"].ToString(), "TSIE-GEHM-TAKUCF");
         Date_Of_Join.Text     = find.Students(Student_ID()).Rows[0]["Date_Of_Join"].ToString();
         Date_Of_Join.Enabled  = false;
         Institute.Text        = find.Students(Student_ID()).Rows[0]["Institute"].ToString();
         Institute.Enabled     = false;
         Date_Of_Birth.Text    = find.Students(Student_ID()).Rows[0]["Date_Of_Birth"].ToString();
         Batch.Text            = find.Batches(find.Students(Student_ID()).Rows[0]["Batch_ID"].ToString()).Rows[0]["Title"].ToString();
         Batch.Enabled         = false;
     }
 }
Ejemplo n.º 5
0
        protected void All_Students_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string Student_ID = DataBinder.Eval(e.Row.DataItem, "Student_ID").ToString();

                Label Student_Name = (Label)e.Row.FindControl("Student_Name");
                Label Contact      = (Label)e.Row.FindControl("Contact");
                Label Email        = (Label)e.Row.FindControl("Email");
                Label IsChecked    = (Label)e.Row.FindControl("IsChecked");

                if (find.Students(Student_ID).Rows.Count != 0)
                {
                    Student_Name.Text   = find.Students(Student_ID).Rows[0]["Name"].ToString();
                    Contact.Text        = secure.Decrypt(find.Students(Student_ID).Rows[0]["Contact"].ToString(), "TSIE-GEHM-TAKUCF");;
                    Email.Text          = secure.Decrypt(find.Students(Student_ID).Rows[0]["Email"].ToString(), "TSIE-GEHM-TAKUCF");;
                    IsChecked.ForeColor = Color.Red;
                    IsChecked.Text      = "Uncheck";
                }
            }
        }
        protected void All_Students_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Label  Student_Name = (Label)e.Row.FindControl("Student_Name");
                Label  Father_Name  = (Label)e.Row.FindControl("Father_Name");
                Label  Contact      = (Label)e.Row.FindControl("Contact");
                Label  Email        = (Label)e.Row.FindControl("Email");
                Label  Batch        = (Label)e.Row.FindControl("Batch");
                Label  Date_Of_Join = (Label)e.Row.FindControl("Date_Of_Joining");
                Label  Institute    = (Label)e.Row.FindControl("Institute");
                Button Chng_Status  = (Button)e.Row.FindControl("Change_Status");

                Student_Name.Text = DataBinder.Eval(e.Row.DataItem, "Name").ToString();
                Father_Name.Text  = DataBinder.Eval(e.Row.DataItem, "Father_Name").ToString();
                Contact.Text      = secure.Decrypt(DataBinder.Eval(e.Row.DataItem, "Contact").ToString(), "TSIE-GEHM-TAKUCF");
                Email.Text        = secure.Decrypt(DataBinder.Eval(e.Row.DataItem, "Email").ToString(), "TSIE-GEHM-TAKUCF");
                string batch_id = DataBinder.Eval(e.Row.DataItem, "Batch_ID").ToString();
                Batch.Text        = find.Batches(batch_id).Rows.Count != 0 ? find.Batches(batch_id).Rows[0]["Title"].ToString() : "No Batch Assigned";
                Date_Of_Join.Text = DataBinder.Eval(e.Row.DataItem, "Date_Of_Join").ToString();
                Institute.Text    = DataBinder.Eval(e.Row.DataItem, "Institute").ToString();
                string chng_stts = DataBinder.Eval(e.Row.DataItem, "Status").ToString();
                Chng_Status.CommandArgument = DataBinder.Eval(e.Row.DataItem, "Student_Id").ToString();
                Chng_Status.CommandName     = DataBinder.Eval(e.Row.DataItem, "Status").ToString();
                if (chng_stts == "1")
                {
                    Chng_Status.Text        = "Block";
                    Chng_Status.BackColor   = Color.Red;
                    Chng_Status.BorderColor = Color.Red;
                    Chng_Status.ForeColor   = Color.White;
                }
                else
                {
                    Chng_Status.Text        = "Unblock";
                    Chng_Status.BackColor   = Color.Green;
                    Chng_Status.BorderColor = Color.Green;
                    Chng_Status.ForeColor   = Color.White;
                }
            }
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((Request.QueryString["Test_ID"] != null))
            {
                test_id = secure.Decrypt(Request.QueryString["Test_ID"], "MONE-YMAT-TERSLT");
                string student_id = Student_ID();
                string giving_id  = Giving_ID(test_id);

                int q_count    = find.Test_Maker(test_id).Rows.Count;
                int done_count = find.Giving_Ans(giving_id).Rows.Count;

                if (q_count > done_count)
                {
                    mbox.Visible = true;
                    if (!IsPostBack)
                    {
                        Load_Test(test_id);
                        loaded_count++;
                    }
                }
                else
                {
                    Response.Redirect("Sheets.aspx?gid=" + secure.Encrypt(giving_id, "momo-ctni-isbest"));
                }
            }
        }
Ejemplo n.º 8
0
        protected void CHng_Pg_Click(object sender, EventArgs e)
        {
            string batch_test_id = secure.Decrypt(Batch_Test_IDFld.Value, "MONE-YMAT-TERSLT");

            if (find.Giving(Student_ID(), batch_test_id).Rows.Count == 0)
            {
                args[0] = Student_ID();
                args[1] = batch_test_id;
                args[2] = DateTime.Now.ToString();
                insertion.Giving(args);
            }
            string url = "Test_Page.aspx?Test_ID=" + secure.Encrypt((find.Batch_Test(batch_test_id).Rows.Count != 0 ? find.Batch_Test(batch_test_id).Rows[0]["Test_ID"].ToString() : "UNKOWN"), "MONE-YMAT-TERSLT");

            Response.Redirect(url);
        }
Ejemplo n.º 9
0
        public void TestEncryptThenDecrypt()
        {
            (string EncryptedValueBase64Encoded, byte[] IV, byte[] Salt)encrypted;
            using (var secure = new Secure())
            {
                encrypted = secure.Encrypt("master password", null, "value to encrypt");
                Assert.NotEqual("value to encrypt", encrypted.EncryptedValueBase64Encoded);

                var decrypted = secure.Decrypt("master password", encrypted.IV, encrypted.Salt, encrypted.EncryptedValueBase64Encoded);
                Assert.Equal("value to encrypt", decrypted);
            }

            using (var secure = new Secure())
            {
                var decrypted = secure.Decrypt("master password", encrypted.IV, encrypted.Salt, encrypted.EncryptedValueBase64Encoded);
                Assert.Equal("value to encrypt", decrypted);
            }
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["gid"] != null && !IsPostBack)
            {
                string Giving_ID = secure.Decrypt(Request.QueryString["gid"], "momo-ctni-isbest");
                All_Questions.DataSource = find.Giving_Ans(Giving_ID);
                All_Questions.DataBind();

                if (find.Giving(Giving_ID).Rows.Count != 0)
                {
                    studentdtl.Visible = true;
                    string Student_id    = find.Giving(Giving_ID).Rows[0]["Student_ID"].ToString();
                    string Batch_Test_ID = find.Giving(Giving_ID).Rows[0]["Batch_Test_ID"].ToString();
                    if (find.Batch_Test(Batch_Test_ID).Rows.Count != 0 && find.Students(Student_id).Rows.Count != 0)
                    {
                        string Batch_ID = find.Batch_Test(Batch_Test_ID).Rows[0]["Batch_ID"].ToString();
                        string Test_ID  = find.Batch_Test(Batch_Test_ID).Rows[0]["Test_ID"].ToString();

                        if (find.Test(Test_ID).Rows.Count != 0)
                        {
                            Sheet_title.Text = find.Test(Test_ID).Rows[0]["Name"].ToString();
                        }

                        if (find.Batches(Batch_ID).Rows.Count != 0)
                        {
                            Sheet_title.Text = Sheet_title.Text + " || " + find.Batches(Batch_ID).Rows[0]["Title"].ToString();
                        }

                        Sheet_Name.Text    = find.Students(Student_id).Rows[0]["Name"].ToString();
                        Sheet_Contact.Text = secure.Decrypt(find.Students(Student_id).Rows[0]["Contact"].ToString(), "TSIE-GEHM-TAKUCF");
                        Sheet_Email.Text   = secure.Decrypt(find.Students(Student_id).Rows[0]["Email"].ToString(), "TSIE-GEHM-TAKUCF");

                        Sheet_Date.Text = find.Giving(Giving_ID).Rows[0]["TimeStamp"].ToString();
                    }
                }
            }
            else if (Request.QueryString["tid"] != null && !IsPostBack)
            {
                studentdtl.Visible = false;
                string tid = secure.Decrypt(Request.QueryString["tid"].ToString(), "momo-ctni-isbest");
                All_Questions.DataSource = find.Test_Maker(tid);
                All_Questions.DataBind();
            }
        }
Ejemplo n.º 11
0
        private string Students(string batch_name)
        {
            string    data     = "";
            string    Batch_ID = find.Batch_Name(batch_name).Rows.Count != 0 ? find.Batch_Name(batch_name).Rows[0]["Batch_ID"].ToString() : "0";
            DataTable dt       = search.Students();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                int Activate = 0;
                if (dt.Rows[i]["Batch_ID"].ToString() == Batch_ID)
                {
                    Activate = 1;
                }
                data = data + dt.Rows[i]["Name"].ToString() + "," + dt.Rows[i]["Father_Name"].ToString() + "," +
                       secure.Decrypt(dt.Rows[i]["Contact"].ToString(), "TSIE-GEHM-TAKUCF") + "," + secure.Decrypt(dt.Rows[i]["Email"].ToString(), "TSIE-GEHM-TAKUCF") + "," +
                       dt.Rows[i]["Date_Of_Join"].ToString() + "," +
                       dt.Rows[i]["Institute"].ToString().Substring(0, 10) + "," + dt.Rows[i]["Date_Of_Birth"].ToString().Substring(0, 10) + "," +
                       dt.Rows[i]["Status"].ToString() + "," + Activate.ToString() + ";";
            }
            return(data);
        }
Ejemplo n.º 12
0
        private static void DecryptPassword(PasswordDb db, PasswordGroup passwordGroup, PasswordEntry passwordEntry)
        {
            while (true)
            {
                if (!passwordEntry.IsValueEncrypted || masterPassword != null)
                {
                    break;
                }
                Console.WriteLine();
                Console.Write("Enter master password: "******"Invalid master password entered, please try again.");
                        continue;
                    }
                    masterPassword = enteredMasterPassword;
                    break;
                }
            }

            Console.WriteLine();
            Console.WriteLine($"Group: {passwordGroup.GroupName}");
            Console.WriteLine($"Name: {passwordEntry.Name}");
            var passwordValue = passwordEntry.Value;

            if (passwordEntry.IsValueEncrypted)
            {
                using (var secure = new Secure())
                {
                    passwordValue = secure.Decrypt(masterPassword, db.IV, passwordEntry.Salt, passwordValue);
                }
            }
            Console.WriteLine($"Value: {passwordValue}");
            Console.WriteLine();
            Console.WriteLine("Press return to continue...");
            Console.ReadLine();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["Create_Question"] == "TRUE" && Request.QueryString["Keyword"] == "OMNI")
                {
                    Create_Question();
                }
                if (Request.QueryString["QID"] != null)
                {
                    string qid = secure.Decrypt(Request.QueryString["QID"], "4444-0495-253535");
                    if (find.Question(Convert.ToInt32(qid)).Rows.Count != 0)
                    {
                        args[0] = ttl_box.Value = find.Question(Convert.ToInt32(qid)).Rows[0]["Title"].ToString();
                        args[1] = dur_box.Value = find.Question(Convert.ToInt32(qid)).Rows[0]["Duration"].ToString();
                        args[2] = text_ans.Value = secure.Decrypt(find.Question(Convert.ToInt32(qid)).Rows[0]["Text"].ToString(), "1111-2222-123123");
                        args[6] = fill_up_box.Value = secure.Decrypt(find.Question(Convert.ToInt32(qid)).Rows[0]["Fill_Ups"].ToString(), "1111-2222-123123");
                        if (find.Question(Convert.ToInt32(qid)).Rows[0]["Audio_Ans"].ToString() == "1")
                        {
                            args[8]         = "1";
                            aud_ans.Checked = true;
                        }
                        if (find.Question(Convert.ToInt32(qid)).Rows[0]["Accept_Text"].ToString() == "1")
                        {
                            args[7]          = "1";
                            text_ans.Checked = true;
                        }
                        args[10] = find.Question(Convert.ToInt32(qid)).Rows[0]["Type"].ToString();

                        string out_mcq = "";
                        for (int i = 0; i < find.MCQs(qid).Rows.Count; i++)
                        {
                            if (find.MCQs(qid).Rows[i]["Answer"].ToString() == "1")
                            {
                                out_mcq = out_mcq + "<span class='mcq ans'>" + (i + 1) + ") " + secure.Decrypt(find.MCQs(qid).Rows[i]["MCQ"].ToString(), "1111-2222-123123") + "</span>";
                            }
                            else
                            {
                                out_mcq = out_mcq + "<span class='mcq'>" + (i + 1) + ") " + secure.Decrypt(find.MCQs(qid).Rows[i]["MCQ"].ToString(), "1111-2222-123123") + "</span>";
                            }
                        }
                        MCQs.InnerHtml = out_mcq;

                        args[3]  = null;
                        args[4]  = null;
                        args[5]  = null;
                        args[8]  = null;
                        args[9]  = DateTime.Now.ToString();
                        args[10] = "Unknown";
                        args_2_cookies();
                    }
                }
            }
            reqCookies = Request.Cookies["Question_Info"];
            if (reqCookies != null)
            {
                cookies_2_args();
            }
            else
            {
                reqCookies = HttpContext.Current.Request.Cookies["Question_Info"];
                if (reqCookies != null)
                {
                    cookies_2_args();
                }
            }
        }
Ejemplo n.º 14
0
        //public UserDetailsBEL CheckPhoneNoExists(string Phone_No)
        //{
        //    UserDetailsBEL Userdetail = new UserDetailsBEL();
        //    //SqlConnection conn = new SqlConnection();
        //    DataSet ds = null;
        //    try
        //    {
        //        SqlParameter[] SqlParms = new SqlParameter[2];

        //        SqlParms[0] = new SqlParameter("@Phone_No", SqlDbType.VarChar, 10);
        //        SqlParms[0].Direction = ParameterDirection.Input;
        //        SqlParms[0].Value = Phone_No;

        //        SqlParms[1] = new SqlParameter("@Error", SqlDbType.VarChar, 150);
        //        SqlParms[1].Direction = ParameterDirection.Output;

        //        ds = SqlHelper.ExecuteDataset(connectionString, CommandType.StoredProcedure, "TW_CheckPhoneNo", SqlParms);
        //        //&& Convert.ToString(SqlParms[5].Value) != "0"
        //        if (Convert.ToString(SqlParms[1].Value) == string.Empty)
        //        {
        //            Userdetail.User_ID = ds.Tables[0].Rows[0]["User_ID"].ToString();
        //            Userdetail.Alternate_Email_Id = ds.Tables[0].Rows[0]["Alternate_Email_Id"].ToString();
        //            Userdetail.Email_Id = ds.Tables[0].Rows[0]["Email_Id"].ToString();
        //            Userdetail.First_Name = ds.Tables[0].Rows[0]["First_Name"].ToString();
        //            Userdetail.Last_Login = ds.Tables[0].Rows[0]["Last_Login"].ToString();
        //            Userdetail.Last_Name = ds.Tables[0].Rows[0]["Last_Name"].ToString();
        //            //Userdetail.Owner_Address = ds.Tables[0].Rows[0]["Owner_Address"].ToString();
        //            Userdetail.Phone_No1 = ds.Tables[0].Rows[0]["Phone_No1"].ToString();
        //            Userdetail.Phone_No2 = ds.Tables[0].Rows[0]["Phone_No2"].ToString();
        //            // Userdetail.SignUp_Mode_ID = ds.Tables[0].Rows[0]["SignUp_Mode_ID"].ToString();
        //            //Userdetail.User_Name = ds.Tables[0].Rows[0]["User_Name"].ToString();
        //            Userdetail.ErrorMessage = string.Empty;
        //            Userdetail.User_Name = ds.Tables[0].Rows[0]["First_Name"].ToString() + " " + ds.Tables[0].Rows[0]["Last_Name"].ToString(); ;
        //            // Userdetail.Last_Login =

        //            // ResultDTO. = Convert.ToString(SqlParms[5].Value);
        //        }
        //        else
        //        {
        //            Userdetail.User_Name = "";
        //            Userdetail.User_ID = "0";
        //            Userdetail.ErrorMessage = Convert.ToString(SqlParms[4].Value);
        //        }

        //    }
        //    catch (Exception ex)
        //    {
        //        Userdetail.User_Name = "";
        //        Userdetail.User_ID = "0";
        //        Userdetail.ErrorMessage = ex.Message.ToString();

        //    }
        //    return Userdetail;

        //}


        #region  UserDashboard
        public PersonalinfoBEL GetProfileInfo(string User_id)
        {
            PersonalinfoBEL personelInfo = new PersonalinfoBEL();

            try
            {
                DataSet ds = null;

                SqlParameter[] SqlParms = new SqlParameter[2];

                SqlParms[0]           = new SqlParameter("@User_id", SqlDbType.NVarChar);
                SqlParms[0].Direction = ParameterDirection.Input;
                SqlParms[0].Value     = User_id;


                SqlParms[1]           = new SqlParameter("@Error", SqlDbType.NVarChar, 150);
                SqlParms[1].Direction = ParameterDirection.Output;

                //SqlParms[7] = new SqlParameter("@UserId", SqlDbType.NVarChar, 20);
                //SqlParms[7].Direction = ParameterDirection.Output;

                //jfhjff

                ds = SqlHelper.ExecuteDataset(connectionString, CommandType.StoredProcedure, "Get_ProfileInfo", SqlParms);

                if (Convert.ToString(SqlParms[1].Value) == string.Empty)
                {
                    personelInfo.User_Id    = Convert.ToInt32(ds.Tables[0].Rows[0]["User_id"]);
                    personelInfo.First_Name = ds.Tables[0].Rows[0]["First_Name"].ToString();
                    personelInfo.Last_Name  = ds.Tables[0].Rows[0]["Last_Name"].ToString();
                    if (ds.Tables[0].Rows[0]["DOB"] != DBNull.Value)
                    {
                        personelInfo.DOB = Convert.ToDateTime(ds.Tables[0].Rows[0]["DOB"]);
                    }

                    personelInfo.Email_ID                  = ds.Tables[0].Rows[0]["Email_Id"].ToString();
                    personelInfo.Alternate_Email_Id        = ds.Tables[0].Rows[0]["Alternate_Email_Id"].ToString();
                    personelInfo.MobileNo                  = ds.Tables[0].Rows[0]["Phone_No1"].ToString();
                    personelInfo.AlternateNo               = ds.Tables[0].Rows[0]["Phone_No2"].ToString();
                    personelInfo.Driving_License           = ds.Tables[0].Rows[0]["Driving_License"].ToString();
                    personelInfo.Pan_No                    = ds.Tables[0].Rows[0]["PAN"].ToString();
                    personelInfo.Owner_Address             = ds.Tables[0].Rows[0]["Owner_Address"].ToString();
                    personelInfo.Owner_Verification_Status = Convert.ToChar(ds.Tables[0].Rows[0]["OwnerVerificationStatus"]);

                    personelInfo.Last_Login = ds.Tables[0].Rows[0]["Last_Login"].ToString();
                    personelInfo.Password   = Secure.Decrypt(ds.Tables[0].Rows[0]["Password"].ToString());

                    return(personelInfo);
                }
                else
                {
                    personelInfo.Success      = false;
                    personelInfo.ErrorMessage = Convert.ToString(SqlParms[1].Value);
                    return(personelInfo);
                }
            }
            catch (Exception ex)
            {
                personelInfo.Success      = false;
                personelInfo.ErrorMessage = Convert.ToString(ex.Message.ToString());
                return(personelInfo);
            }

            //  return AvailableParkings;
        }
Ejemplo n.º 15
0
        public async Task <ActionResult> Decrypt([FromForm] EncryptDecryptInfo info)
        {
            logger.LogDebug("Received decrypt info: {0}", info);
            if (!ModelState.IsValid)
            {
                return(new ObjectResult(new {
                    Decrypted = false,
                    Reason = ActionFailReason.InvalidInput,
                    Group = info.Group,
                    Entry = info.Entry
                }));
            }

            var masterPassword = info.MasterPassword;

            if (string.IsNullOrWhiteSpace(masterPassword))
            {
                masterPassword = this.RememberedMasterPassword();
            }
            else if (info.RememberMasterPassword)
            {
                this.RememberMasterPassword(info.MasterPassword);
            }

            if (string.IsNullOrWhiteSpace(masterPassword))
            {
                return(new ObjectResult(new {
                    Decrypted = false,
                    Reason = ActionFailReason.NeedMasterPassword,
                    Group = info.Group,
                    Entry = info.Entry
                }));
            }

            using (var secure = new Secure())
            {
                var userAccount = await userAccountRepository.GetUserAccountAsync(User);

                var passwordDb = userAccount.GetPasswordDb();

                if (!secure.ValidateHash(masterPassword, passwordDb.MasterPassword))
                {
                    return(new ObjectResult(new {
                        Added = false,
                        Reason = ActionFailReason.MasterPasswordInvalid,
                        Group = info.Group,
                        Entry = info.Entry
                    }));
                }

                var group = passwordDb.PasswordGroups.FirstOrDefault(pg => pg.GroupName == info.Group);
                if (group == null)
                {
                    return(new ObjectResult(new {
                        Decrypted = false,
                        Reason = ActionFailReason.InvalidInput,
                        Group = info.Group,
                        Entry = info.Entry
                    }));
                }
                var entry = group.PasswordEntries.FirstOrDefault(pe => pe.Name == info.Entry);
                if (entry == null)
                {
                    return(new ObjectResult(new {
                        Decrypted = false,
                        Reason = ActionFailReason.InvalidInput,
                        Group = info.Group,
                        Entry = info.Entry
                    }));
                }
                if (!entry.IsValueEncrypted)
                {
                    return(new ObjectResult(new {
                        Decrypted = true,
                        DecryptedValue = entry.Value,
                        Group = info.Group,
                        Entry = info.Entry
                    }));
                }

                return(new ObjectResult(new {
                    Decrypted = true,
                    DecryptedValue = secure.Decrypt(masterPassword, passwordDb.IV, entry.Salt, entry.Value),
                    Group = info.Group,
                    Entry = info.Entry
                }));
            }
        }