security

How to change the Lock screen custom text(Owner Info)?

对着背影说爱祢 提交于 2020-02-21 04:05:38
问题 I wrote the program code String message = "This is test"; Settings.System.putString(context.getContentResolver(), Settings.Secure.LOCK_PATTERN_ENABLED, message); This is not changing the lock screen text(Owner Info) and Added permission as <uses-permission android:name="android.permission.WRITE_SETTINGS" /> 回答1: Change Settings.Secure.LOCK_PATTERN_ENABLED to Settings.System.NEXT_ALARM_FORMATTED . Note that Settings.System.NEXT_ALARM_FORMATTED was deprecated in API level 21. You must use

Android Encryption and Decryption Error - javax.crypto.IllegalBlockSizeException: last block incomplete in decryption

≡放荡痞女 提交于 2020-02-20 06:18:17
问题 I have an issue with the decryption in the following code. I have a encrypted string being sent to setData(). I am trying to decrypt the encrypted string(data). The error I keep getting is javax.crypto.IllegalBlockSizeException: last block incomplete in decryption byte[] data; String key = "tkg96827pco74510"; byte[] encryptedOut; String decryptedOut; Key aesKey; Cipher cipher; public void setData(String dataIn){ this.data = dataIn.getBytes(); try { aesKey = new SecretKeySpec(key.getBytes(),

Android Encryption and Decryption Error - javax.crypto.IllegalBlockSizeException: last block incomplete in decryption

你离开我真会死。 提交于 2020-02-20 06:18:11
问题 I have an issue with the decryption in the following code. I have a encrypted string being sent to setData(). I am trying to decrypt the encrypted string(data). The error I keep getting is javax.crypto.IllegalBlockSizeException: last block incomplete in decryption byte[] data; String key = "tkg96827pco74510"; byte[] encryptedOut; String decryptedOut; Key aesKey; Cipher cipher; public void setData(String dataIn){ this.data = dataIn.getBytes(); try { aesKey = new SecretKeySpec(key.getBytes(),

Best and secure way to send parameters in URL

倾然丶 夕夏残阳落幕 提交于 2020-02-20 04:33:31
问题 I am working on a website in which there would be functionalities to update and delete data on the basis of id. Now the thing I am worried about is like my url would be www.example.com/public/controller/action/1 if the action would be delete , any person can change id from 1 to 2 in url and the data with id 2 would get deleted. What would be the best way to keep the flow secure. I am using Zf2 and Doctrine2... Any suggestions please !!! And moreover I am keeping ids hidden in fields, anybody

Can a JavaScript hosted on different domain read/modify DOM of another domain?

眉间皱痕 提交于 2020-02-18 05:21:42
问题 I have a question regarding a potential security issue/limitation regarding JavaScript hosted on a domain (ex: domain of a CDN, say example.com), but loaded from a website under a different domain (say, example.net). Now imagine that the JavaScript loaded will just read/modify text in a div with a particular id, so nothing "complicated". An example: I have the script loaded from http://example.com/myscript.js, and executed on http://example.net/index.html: [note the different TLD!] <!-- Page

RegistrySecurity Access is denied. C#

ぐ巨炮叔叔 提交于 2020-02-15 07:31:38
问题 I'm currently having an issue when writing an app to set permissions on some Legacy keys. Legacy keys are quite locked down and to actually modify them in regedit you have to take ownership and then add yourself with full control. When trying to replicate this in code i cannot get the key for write with the error "Access is denied". Example code: RegistrySecurity rs = new RegistrySecurity(); rs.AddAccessRule(new RegistryAccessRule("Administrators", RegistryRights.FullControl,

RegistrySecurity Access is denied. C#

对着背影说爱祢 提交于 2020-02-15 07:30:53
问题 I'm currently having an issue when writing an app to set permissions on some Legacy keys. Legacy keys are quite locked down and to actually modify them in regedit you have to take ownership and then add yourself with full control. When trying to replicate this in code i cannot get the key for write with the error "Access is denied". Example code: RegistrySecurity rs = new RegistrySecurity(); rs.AddAccessRule(new RegistryAccessRule("Administrators", RegistryRights.FullControl,

MVC Web Api won't allow Windows Authentication

杀马特。学长 韩版系。学妹 提交于 2020-02-14 23:03:31
问题 I have a simple MVC web api 2 IIS hosted application which I want to enable windows authentication (initially not using Owin). I am running this on my development machine and running as local IIS. So, from what I could find, I need to add the following to the web.config 1: to the following section the authentication mode="Windows" <system.web> <compilation debug="true" targetFramework="4.5.1"/> <httpRuntime targetFramework="4.5.1"/> <authentication mode="Windows" /> </system.web> 2: Then add

MVC Web Api won't allow Windows Authentication

独自空忆成欢 提交于 2020-02-14 23:03:30
问题 I have a simple MVC web api 2 IIS hosted application which I want to enable windows authentication (initially not using Owin). I am running this on my development machine and running as local IIS. So, from what I could find, I need to add the following to the web.config 1: to the following section the authentication mode="Windows" <system.web> <compilation debug="true" targetFramework="4.5.1"/> <httpRuntime targetFramework="4.5.1"/> <authentication mode="Windows" /> </system.web> 2: Then add

Preventing Cookie replay attacks in ASP.Net MVC

折月煮酒 提交于 2020-02-14 06:32:10
问题 I have been tasked with implementing point 4 in this article: http://support.microsoft.com/kb/900111 This involves using the Membership provider to add a comment to users server side records when they log in and out, and then confirming that when a cookie is used to authenticate, that the user hasn't logged out. This makes perfect sense to me. Where this starts to fall apart is that we do not currently use a membership provider, and so it seems like I face reimplementing all our