password-protection

How to not hardcode passwords?

自古美人都是妖i 提交于 2019-11-29 09:13:59
问题 In my last question "Portable database for storing secrets" the best answer until now tell to use sqlite-crypt. Reading sqlite-crypt docs, the new param for open the database is the pass-phrase. Of course, I don't want hardcode the password, so I was thinking what the best, simple and fast method to store that password? 回答1: Some options. Ask the user for a passkey (aka they memorize one password to get to all their password) (good idea) Create a key on the first startup of the app, which is

VBA Project Password-Protect with SendKeys not Working Correctly

江枫思渺然 提交于 2019-11-29 08:40:39
I've spent the last two days working on this problem. Most of the content I've found on this topic doesn't address the issue I'm having, so I'm hopeful that someone here can help me. I've been working on some code that does the following from a "master scorecard" workbook: Takes each "student" sheet in the workbook and copies the sheet into a new workbook, Does a few minor manipulations of the new workbook, Imports a module of code into the new workbook, Adds a Workbook_Open event and a Workbook_BeforeClose event to the new workbook (to make certain sheets xlVeryHidden depending on level of

ZIP a file and protect with a password in PHP

我只是一个虾纸丫 提交于 2019-11-29 07:58:39
I'm having this code to zip files but i need to protect this file with a password $file = 'backup.sql'; $zipname = $file.'.zip'; $zip = new ZipArchive; $zip->open($zipname, ZipArchive::CREATE); ZipArchive::setPassword('123456'); //$zip->setPassword("123456"); $zip->addFile($file); $zip->close(); when i use $zip->setPassword i don't get any errors but the file is not protected at all and when i use ZipArchive::setPassword i get this error "Fatal error: Non-static method ZipArchive::setPassword() cannot be called statically" So how to zip a file in php and protect it with a password? Yes,

What way is the best way to hash a password? [duplicate]

匆匆过客 提交于 2019-11-29 07:27:18
This question already has an answer here: Secure hash and salt for PHP passwords 14 answers I'm working on a website that should be very safe for the users, so I need the hash the passwords. Usually I'm using the MD5, but I read that it doesn't safe anymore. So I tried PHPass, but then I read that it also has been cracked. So I tried password_hash() of PHP 5.5, but I use HostGator, and the PHP there is 5.4. Also I want to be able to add salt without knowing it (like time() * userid() ), like in the password_hash() . The hash strength is very important to me because I want to be 100% sure that

.htaccess in subdirectory 'overriding' parent htaccess

倖福魔咒の 提交于 2019-11-29 06:11:16
been searching for 2 days and can't quite get the right solution due to my lack of understanding of mod_rewrite and time constraints on this project so hoping someone can help. The aim To rewrite all requests to the root index.php if the client doesn't have the correct cookie. If the client has the correct cookie allow them to browse as they wish. The problem The htaccess in my subdirectory is taking precendence over my root htaccess, so requests such as www.mydomain.com/subdir/index.php arn't getting redirected. My root .htaccess Options FollowSymLinks RewriteEngine On RewriteBase /

How to start a dialog (like alarm dimiss /snooze) that can be clicked without unlocking the screen

 ̄綄美尐妖づ 提交于 2019-11-29 02:14:29
I dont want to permanently bypass keyguard, just for that moment .For example when a alarm is raised (eg wake up alarm) i can dismiss /snooze it whithout unlocking screen .I want to achive the same behaviour.I want start a dialog which should be on top on locked screen. I can click button on dialog without unlocking .Is this possible ?If yes how? I dont want the following : private void unlockScreen(Context context){ Log.d("dialog", "unlocking screen now"); PowerManager powermanager = ((PowerManager)context.getSystemService(Context.POWER_SERVICE)); WakeLock wakeLock = powermanager.newWakeLock

htaccess doesn't work - always wrong password

*爱你&永不变心* 提交于 2019-11-29 01:07:28
I am trying to password protect a directory, and have two files in the directory which should password protected it: .htaccess .htpasswd HTACCESS: ###Contents of .htaccess: AuthUserFile /var/www/html/path/to/my/directory/.htpasswd AuthName "Protected Files" AuthType Basic Require user admin HTPASSWD: ###Contents of .htpasswd admin:oxRHPuqwKiANY The password is also admin, but no matter what password I try, it is always wrong. It immediately asks for the password again! What is wrong with this configuration? This problem is almost always because apache cannot read the .htpasswd file. There are

How to create a password protected pdf file

女生的网名这么多〃 提交于 2019-11-29 00:43:10
I'm using html2fpdf for creating PDF documents. Now once I have created that, I want to make sure that the PDF file is password protected. How can this be done in PHP? Mohit Jain Download the library I am using from a blog post on the ID Security Suite site : <?php function pdfEncrypt ($origFile, $password, $destFile){ require_once('FPDI_Protection.php'); $pdf =& new FPDI_Protection(); $pdf->FPDF('P', 'in'); //Calculate the number of pages from the original document. $pagecount = $pdf->setSourceFile($origFile); //Copy all pages from the old unprotected pdf in the new one. for ($loop = 1; $loop

What are Salt Rounds and how are Salts stored in Bcrypt?

岁酱吖の 提交于 2019-11-29 00:03:53
问题 I'm trying to configure Bcrypt for a node app that I'm making and have several questions about salts that I hope someone here can help kindly answer. What is a salt 'round'? For example, in the github docs (https://github.com/kelektiv/node.bcrypt.js/) it uses a salt round of 10. What does that mean exactly? Is the salt generated by Bcrypt always the same? For example, if I am saving user's hashed passwords to a DB, is the salt that it used to hash the password the same for every password? How

Password protecting my android app (the simple way)

只谈情不闲聊 提交于 2019-11-28 23:48:37
I've built my first app, and I would like to password protect it. It's fine for me to store the password in the Java files and the method needs to be as simple as possible because i have no experience of java or even xml before this app. I've had a few attempts and failed so I was hoping someone can help me out. I've created the layout with an EditText field: <EditText android:id="@+id/passwordedittext" android:layout_width="200dp" android:layout_height="50dp" android:inputType="textPassword" android:layout_marginTop="40dp" android:layout_marginLeft="20dp"> <requestFocus /> and a submit button