security

How do I use SecureString securely?

血红的双手。 提交于 2020-01-22 06:45:28
问题 All of the examples I have seen end up converting a SecureString back to a standard string before using it, defeating the object. What's a good way of using a secure string without this problem? I know I can marshall the SecureString to a BSTR but what can I do with this BSTR? Can I get the characters back one at a time? If so, how? 回答1: This link includes a lot of helpful information, including how to get an unmanaged memory block for passing the string to native code (that is presumably

How do I use SecureString securely?

浪尽此生 提交于 2020-01-22 06:45:05
问题 All of the examples I have seen end up converting a SecureString back to a standard string before using it, defeating the object. What's a good way of using a secure string without this problem? I know I can marshall the SecureString to a BSTR but what can I do with this BSTR? Can I get the characters back one at a time? If so, how? 回答1: This link includes a lot of helpful information, including how to get an unmanaged memory block for passing the string to native code (that is presumably

How to protect PDF files from being downloaded or copied

三世轮回 提交于 2020-01-21 19:30:39
问题 I'm developing a new website with PHP & MySQL. The website is for an online eBook library that grant access to its books based on paid subscription plans. So, I need to make sure the PDF files of these books are well protected and can't be saved, downloaded, or in anyway copied. How can I do that? 回答1: I suggest you to convert the PDF into an image , and display the first page or as you like, check this library it can be useful Imagemagick 回答2: I think this is not a PHP or MYSQL solution. PDF

How to solve java.security.AccessControlException?

和自甴很熟 提交于 2020-01-21 11:42:10
问题 I am trying to access client's temp directory through my applet on my web project. When I run the applet by itself, it gets the tempdir with no problem. When I try to get it on my project using javascript and calling the applet method, I am having accessControlException on my javascript console. Also I am getting the same exception when I try to read a file under the temp directory. This is what I see exactly: java.security.accesscontrolexception access denied (java.util.propertypermission

Decrypt and encrypt using PBKDF2 java

一曲冷凌霜 提交于 2020-01-21 10:23:01
问题 Is there a way to decrypt PBKDF2 password in java. Java has implementation of PBKDF2 algorithm as PBKDF2WithHmacSHA1 . I got the code to create hashes for password. I referred to below link for hashing technique: http://howtodoinjava.com/security/how-to-generate-secure-password-hash-md5-sha-pbkdf2-bcrypt-examples/ My requirement is to store the third Party FTP server password in the encrypted format and get back the password in plain text form from DB when there is a need to login into the

Access-Control-Allow-Origin not checking in chrome extension

主宰稳场 提交于 2020-01-21 09:47:26
问题 As you know, when send $.ajax(..) request to another domain (cross-domain), most browser throw exception like: XMLHttpRequest cannot load http://mysite.com/test.php. Origin http://127.0.0.1:8888 is not allowed by Access-Control-Allow-Origin. I am creating chrome extension and it should send a request to my website. First , i expected to see above message,too. But i confused when i see it worked fine. First, It’s seem good, it’s working and i have what i want. But it can be horrible. Every one

How to make a secure login using UDID or device token?

删除回忆录丶 提交于 2020-01-21 09:34:24
问题 So I'm making an app where I want the users to be able add, edit and rate content, but I do not want to force them to register. Instead I was planning on just using their device id or device token to identify them. I'm planning on making both an iPhone and Android version, so I'm looking for a general solution, but the iPhone version has higher priority, so an iPhone specific solution would also be welcome. The problem is that I don't want just anyone to be able to use my web service by

How to make a secure login using UDID or device token?

眉间皱痕 提交于 2020-01-21 09:29:45
问题 So I'm making an app where I want the users to be able add, edit and rate content, but I do not want to force them to register. Instead I was planning on just using their device id or device token to identify them. I'm planning on making both an iPhone and Android version, so I'm looking for a general solution, but the iPhone version has higher priority, so an iPhone specific solution would also be welcome. The problem is that I don't want just anyone to be able to use my web service by

Get current/active security zone of a .NET application?

风流意气都作罢 提交于 2020-01-21 07:13:23
问题 I have an application that behaves oddly, and just to verify, I'd like to see which security zone it is currently running under. I've found the System.Security.SecurityZone enum, but can't seem to find anything that will return which of these I'm running under. Does anyone have any tips? Basically I want to find out if my application is running in MyComputer, Intranet, Internet, Untrusted, Trusted, etc. Edit: Here's the minor test-app I wrote to find this code, thanks to @blowdart. using

How to restrict DOS attack with Web API

不问归期 提交于 2020-01-21 06:59:27
问题 I am planning to develop a internet site using MVC4 and Web APi. Its a simple application which will display a customer information based on search. For Search functionality I am calling webApi using Ajax get method (I know i should be using Post, but consider this is the current implementation). My Api call is " /api/Data/getSearchResults/?companyName='" + companyName I feel this piece of line can be used as a DOS attack to bring down my server. Is there way i can use Microsoft Anti-XSS