w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Updating encrypted password-hash stored in XML file to sync with domain password changes
I wrote a bash script that works okay for the purpose. It requires a small addition in ~/.m2/settings.xml for support (see below). The script takes one optional argument: a regex-string used to match optional tag(s) associated with one or more password-hashes in the xml file. I'm using this to indicate Domain-Name, but it could be anything (or nothing, since it is optional). The script prompts for the new password to be hashed, it constrains the newly-generated hash to be pure alpha-numeric (to avoid potential issues with unintended shell-escapes elsewhere), it makes a backup copy of the settings.xml file, and then it updates the selected hashes in settings.xml. Here is the script: #!/bin/bash # Update instances of password-hashes in ~/.m2/settings.xml for a given password [and doma

Categories : Bash

Encrypted password is not saving in database but only salt password
You are not storing register in the database, you are storing the original item(reg). easiset way(least changes would be) public ActionResult Register(Authentication reg, bool captchaValid, string captchaErrorMessage) { if (!captchaValid) ModelState.AddModelError("captcha", captchaErrorMessage); if (ModelState.IsValid) { var crypto = new SimpleCrypto.PBKDF2(); reg.Password = crypto.Compute(reg.Password); reg.PasswordSalt = crypto.Salt; db.Authentications.InsertOnSubmit(reg); db.SubmitChanges(); } return View(); }

Categories : Asp Net Mvc

Is SQL Server password is also sent encrypted
It is encrypted only if your SQL server is set up to use SSL: Encrypting Connections to SQL Server The Encrypt=True setting I believe only marks the string as encrypted in the web.config file.

Categories : Dotnet

encrypted password with sonataadminbundle and fosuserbundle
I suspect you are not using the fos user manager to persist your object? $userManager = $this->get('fos_user.user_manager'); $userManager->update($user,true); The update method takes care of encrypting the passwords as well as several other items such as canocalizating the user name and email. The doc files have more information.

Categories : Symfony2

Unzip password-encrypted files in c#
If you really want to use unzip, you could run first unzip -Z and the 5th element returned from that will be a 't' (text) or a 'b' (binary). If they capital, then the archive is encrypted. References: ZipInfo Manual Unzip Manual

Categories : C#

How to authenticate Oracle login using encrypted password
How exactly are you connecting to the db? If you use sqlplus user/password@database from your commandline/script then you indeeed have a problem. The reason is, that you can easily see the password with the ps command. Obfuscating it with Base64 is not really an encryption, because Base64 is a known algorithm for transfering binary data over the wire. This might baffle some, but certainly is not a safe way of sending a password. What I do in this case, to avoid the password being shown int he process list, is that I write the password to a textfile with read only permission for the local user. Then I run sqlplus with nohup or in the background sqlplus user@db < pwdfile and immediately delete the file again.

Categories : Oracle

Creating user with encrypted password in PostgreSQL
I'm not aware of a way to override the default md5 encryption of passwords, but if you have a ROLE (aka "USER") that has an already md5-encrypted password it appears that you can supply that. Verify this using pg_dumpall -g (to see the globals from the cluster) Eg. psql postgres create role foo with encrypted password foobar; q -- View the role from pg_dumpall -g pg_dumpall -g | grep foo CREATE ROLE foo; ALTER ROLE foo WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN NOREPLICATION PASSWORD 'md5c98cbfeb6a347a47eb8e96cfb4c4b890'; Or get it from: select * from pg_catalog.pg_shadow; -- create the role again with the already-encrypted password psql postgres drop role foo; CREATE ROLE foo; ALTER ROLE foo WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN NOREPLICATION PASSWORD

Categories : Postgresql

In magento how to send encrypted password in email
After a long research i found that there is a variable password_hash magento. It uses the hashing method to encrypt a password which cannot be decrypted. Code Just replace the code {{htmlescape var=$customer.password_hash}} in your email template instead of {{htmlescape var=$customer.password}}.

Categories : Magento

How to match username with encrypted password on login (java)
You don't need to match the pre-encrypted password. Your database stores the encrypted version, so you can take the password the user inputs, encrypt it, and then see if it matches the value in your database.

Categories : Java

Tomcat 6 - authentication through active directory with encrypted password
I think your only alternative is to subclass JNDIRealm and make a new attribute that will have some sort of encrypted connection password. The password can't be hashed (with, e.g. MD5 as you specify) because hashes are one-way--there's no undoing a hash--and Tomcat needs the password in its original unhashed form to authenticate against the AD installation. If you use a reversible encryption in your JNDIRealm subclass, then when Tomcat needs the password you can decrypt the password and pass it along.

Categories : Authentication

Encrypted password in database and browser digest auth
Was just looking into this just now. First, I read through RFC 2617 - HTTP Authentication: Basic and Digest Access Authentication to get some insight into the specification and see how it can be adapted for a REST API authentication. Ran into the same question as you did—Does digest authentication mean the server needs to store the user's password in plaintext? This Stack Overflow answer makes it clear: No. The server doesn't store the plaintext password—it should store the hash of (username|realm|password). That would've been fine except for one thing—the canonical spec only supports using MD5 as the hash function. Of course you could store both the bcrypt hash and the MD5 hash but doing so only undermines the security of the bcrypt hash effectively rendering it useless (since a

Categories : Misc

Load password encrypted pdf file using jblough's AndroidPdfViewer and AES
The error is because key.length returns a value of 128. It should be 16 because the AES 128 key is 16 bytes long.I changed this value final int keyLen =revision == 2 ? 5 : (keyBitLength / 8); to final int keyLen =16; it will only work for AES 128

Categories : Android

C# Base64 encoding / decoding fails when using custom encrypted password
It's because of the way you are interfering with the Unicode "Chars" of the string with the encoding algorithm and then constructing a String using those "Chars" which then might not form a valid Unicode stream. When converting from your String to a Byte array and back again, you need to decide which encoding to use....and you can't arbitrarily change the byte stream (via your encryption routine) and expect it to produce a valid string when being converted back. I've modified your code to show some string to byte[] conversion steps...you can adjust these depending on your need. static void Main(string[] args) { bool Worked = false; string Password = "testing"; Console.WriteLine("Password: " + Password); // == Encode then decode 64 test. DecPass64 should equal password

Categories : C#

Send hashed or encrypted password to AS400 jdbc connection
There is no mention of a property in the IBM Toolbox for Java JDBC properties to accept a special hashed/encrypted password. You are going to have to manage the hashing/encryption of the password within your application and provide it to the JDBC connection as plaintext. The secure property of the JDBC connection can be used to force an SSL connection to the AS/400, assuming SSL is enabled, to ensure that all data is encrypted between the application and the database.

Categories : Java

How can ProFTPD read a password encrypted with the MySQL ENCRYPT() function?
ProFTPD does not need to know what the salt is. Per the MySQL documentation, ENCRYPT uses the Unix crypt() implementation of DES. As you pointed out, if no salt is provided, a random salt is chosen. According to the man pages: The returned value points to the encrypted password, a series of 13 printable ASCII characters (the first two characters represent the salt itself). You can verify this for yourself, by running e.g.: SELECT ENCRYPT ('blowfish'); which returns: 201GDb8Aj8RGU If you then run select ENCRYPT ('blowfish', '201GDb8Aj8RGU'); You'll get the same result 201GDb8Aj8RGU. Only the first two characters are used as salt. It becomes a little clearer if you provide your own salt, such as : SELECT ENCRYPT ('blowfish', 'rb'); The returned value is: rbMle0EHJVX

Categories : Mysql

Storing encrypted username/password for authentication on remote website without OAuth
I would suggest to use encryption framework with good security record instead of "popular encryption algorithms" definition of "somewhere safe" is rather vague, but I think if both you and your users are fine with it — it's ok. Make sure that your users understand how you store their passwords so they are prepared to possible consequences.

Categories : PHP

How to decrypt encrypted password that is stored in database when user logins through login control asp.net c#
You should match the encrypted password and not decrypt all of your passwords. You should temporarly encrypt the password the user inserted and query the database searching for a correspondence with the encrypted password.

Categories : C#

cakephp - change password method leaves blank the password field in database
You forgot one vital part about form processing in the controller: Check on POST. if ($this->request->is('post')) { // only then try to access $this->request->data['User'] content! } In the case thats it not a post (get), you just display the form - especially without trying to save anything. Tip: Take a look at baked code (using cake bake) and you will see how it's done properly.

Categories : Cakephp

Reducing image height and width by 50% but image size on disk remains the same
Per Bitmap's Android doc: quality Hint to the compressor, 0-100. 0 meaning compress for small size, 100 meaning compress for max quality. Some formats, like PNG which is lossless, will ignore the quality setting Your original input is JPG, but you are outputting it to PNG. Since JPG will always have quality degradation that introduce artifacts, making the generated PNG files larger when converted. Try saving it as JPG with 80-100 quality instead. Also, in my tests compressing to PNG take 2-5x more time than compressing to JPG, due to PNG compression is done in software and JPG in hardware. So for most images it's probably better to compress to JPG.

Categories : Java

Clutter.Image Properties -- Loading an image from disk
there is no property or function for loading texture data from file to a Clutter.Image instance. you should use Gdk.Pixbuf to load the image data from file, buffer, or stream, and then put it in a Clutter.Image with something like: let pixbuf = Gdk.Pixbuf.new_from_file('...'); let image = new Clutter.Image(); image.set_data(pixbuf.get_pixels(), pixbuf.has_alpha() ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888, pixbuf.get_width(), pixbuf.get_height(), pixbuf.get_rowstride()); which should work; if it doesn't, then it's an introspection issue, and will likely need some tweaks in GdkPixbuf.

Categories : Javascript

Random access to an encrypted file and write encrypted data into a specific offset in Android
The whole file has to be re-encrypted, with a new initialization vector, every time it is changed. Any other approach is insecure. ECB mode supports random access without re-encryption, but ECB does not satisfy the "secure" requirement per se. CBC mode does not support random access. CTR mode does support random access, but you must never use it this way, because it counts as nonce reuse, which results in plaintext recovery.

Categories : Android

Change form input attribute 'name' to 'data-encrypted-name'
Define a custom widget class inheriting from whatever widget type your numbers field defaults to (TextInput, judging from the tag you're showing) and override its build_attrs method. I'd do it something like this: class SensitiveTextInput(TextInput): def build_attrs(self, extra_attrs=None, **kwargs): attrs = super(SensitiveTextInput, self).build_attrs(extra_attrs, **kwargs) if 'name' in attrs: attrs['data-encrypted-name'] = attrs['name'] del attrs['name'] return attrs If you need to do this for more than a handful of widget types you could abstract this into a mixin.

Categories : Django

how save image to disk
You do not need virtualFile. You already have the image data in imageStringBugger. Thus: with file('filename_to_save_to.png', 'wb') as f: f.write(imageStringBuffer) is enough.

Categories : Python

How to change the Asymmetric Key Pair without changing the Symmetric Key and the encrypted content in CMS with Bouncy Castle
The standard Java crypto libraries actually have caught up to Bouncy Castle IMHO over the past few years. I had used BC on a few projects when Java crypto was lacking but since then implemented an entire security product just using the included classes. Having said this (1st recommendation - use standard Java crypto - good examples, fair documentation), my 2nd suggestion would be to break-out the two components (my apologies but there is no Bouncy Castle specific info here as I haven't used those specific libraries in years): Using a secret-key, symmetrically encrypt the plain-text and store the cipher-text BLOB separately. Using asymmetric encryption (source private-key and target public-key), encrypt the secret-key and store that separately, referencing the key-pair, algorithm, etc th

Categories : Java

How can I force ElementTree to write to disk every change?
I'm not sure exactly how your code works, but it's definitely something that could be done. Depending on how it's structured, you could create a timestamp and compare the incoming data to the old data, or you could scan the file for whether the current XML has already been added. After that (assuming its new code) you could do something like the following: path = "path/" name = "fileName" xmlRoot = Element("root")#create a root element for the xml structure xmlSub = SubElement(xmlRoot,"sub") subName = SubElement(xmlCard,"name") subName.text = "element text" saveName = path + name + ".xml" #constructs location of xml file (path/fileName.xml) tree = ElementTree(xmlRoot) #compiles the tree tree.append(saveName) #appends to specified file This would output the following in a document in t

Categories : Python

how can one change the default disk cache behavior in volley?
I needed the same changed the default caching strategy to a "cache all" policy, without taking into account the HTTP headers. You want to cache for a set period of time. There are several ways you can do this, since there are many places in the code that "touch" the network response. I suggest an edit to the HttpHeaderParser (parseCacheHeaders method at line 39): Cache.Entry entry = new Cache.Entry(); entry.data = response.data; entry.etag = serverEtag; entry.softTtl = softExpire; entry.ttl = now; // **Edited** entry.serverDate = serverDate; entry.responseHeaders = headers; and another to Cache.Entry class: /** True if the entry is expired. */ public boolean isExpired() { return this.ttl + GLOBAL_TTL < System.currentTimeMillis(); } /** True if a refresh is needed from the orig

Categories : Android

efficiently saving image files to disk c#
It's quite possible that your disk just isn't fast enough. A really fast disk subsystem can sustain a write speed of perhaps 100 megabytes per second, and that's if you already have the file open. You're trying to create 30 or more files per second, which in itself is a pretty big load on the system. Add the time required to write the data, and you're pushing the file system's capabilities. That problem will get worse as the number of files in a folder increases. If you have, say, 1,000 files in the folder, things work pretty quickly. Put 10,000 files in a single folder and you'll find that it takes a long time to create a new file in that folder. If you are bumping up against hardware performance limitations, you have several courses of action: Get faster hardware. A second, very fast

Categories : C#

Error creating disk image using hdutil
I had the same problem. The solution I found at Apple Support Communities worked for me. I ended up adding an empty .Trash file into the folder before calling hdiutil: touch root_folder/.Trash or with Ant in my case: <touch file="root_folder/.Trash"/>

Categories : Osx

Error reading image file from disk
Use the lSize you determine in readImg(...) as the file size. strlen is for null terminated strings. dont use strlen to determine image size in bytes. Note also, that you should assign jpgBuffer as a heap variable via new[] using lSize as the byte size. That way you can return a pointer to heap memory. Your current stack variable jpgBuffer will be invalid after the function returns, and hence the pointer to it. This way you also dont have to worry about the situation where you need more bytes than your hardcoded value (which you currently dont check!). You will also want to return the lSize via an input parameter pointer/ref variable so you have a bounds to iterate over later on.

Categories : C++

How to detect the disk full error and let program resume after getting free disk space
Check the return value of each call to fprintf() and fwrite(). If either call returns a negative value, check errno to see if errno is equal to ENOMEM or EDQUOTA. If so, you're probably out of disk space. As for resuming the operation as if nothing ever happened; that's a little bit harder; you'll need to keep track of what data you successfully wrote to the disk, so that after you've notified the user and they've indicated that it's time to try again, you can resume writing that data from the point at which the error occurred. That means keeping the state of the write in a structure of some sort (i.e. not just on the stack) so that you can return from your writing-function and then resume it later on. (Either that, or do the writing in a separate thread, and have the thread notify th

Categories : C++

Image download and cache (in memory or disk) with Libgdx
You may be able to use the Android Universal Image Loader with Libgdx. Any of its image "display" routines will not work, but the code to download and cache images should (?) be fine (when used by your project's Android backend). Look at the Libgdx doc for working with "platform-specific" libraries and APIs: https://code.google.com/p/libgdx/wiki/ApplicationPlatformSpecific I haven't looked too closely at the Loader's code, so this may be a dead end if the display code is too entangled with the rest.

Categories : Android

Database disk image is malformed from many concurrent writes
SQLite does not support storage on a distributed file system. Concurrent access required locking and that is not transferred across such a system. You'll have to move to a database that supports a networked model instead, such as MySQL or PostgreSQL.

Categories : Python

CSS: background-image: url with absolute path to another disk partition
Firstly I suggest you to use a WYSIWYG editor like dreamweaver, visual studio or any for instance. Then make a project folder with the name brig and put all the relevant directories, images, etc inside it relevantly. Then when you open your HTML or css in the editor, select your main project and then when you put the images inside your HTML or CSS via src or url respectively, it will automatically make it relative and fetch it from that place where you have originally stored in your project. For instance, background: url("../task/image.png"); This ../ means a relative path for one level up directories. So in future, when you put your graphic files on the same path, this will fetch the images via a relative path as mentioned. Hope this helps.

Categories : CSS

Disk Backed Image Cache for UIImageView in AFNetworking
The SDWebImage project provides a similar UIImageView category, but offers both in-memory (using NSCache) and on-disk (using NSFileManager) caching. I'd recommend just using that when you need to cache to disk. The downside to this implementation is that your network requests won't go through your AFHTTPClient subclass, so depending on what your needs are you might need to implement your own operation queue, authentication, etc. If you're just using it for something basic, like displaying avatar images in a table view, it should be fine. If that downside bothers you, an alternate idea would be to use SDImageCache (included in the SDWebImage project) to cache the images, and download them yourself using AFNetworking. Finally, note that AFNetworking has built-in support for NSURLCache,

Categories : IOS

iOS Drawing image with objects (arrows) and saving to disk
Try using this code to get a layer screenshot from a desired view: - (UIImage *)imageFromLayer:(CALayer *)layer { UIGraphicsBeginImageContext([layer frame].size); [layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return outputImage; }

Categories : IOS

How do I check on disk if the thumbnail image is present and optionally use it in ASP.NET MVC 3?
I would do such processing in a separate process, preferably Windows Service. AppDomain can be recycled by IIS and your thumbnail processing thread may be killed in the middle of work. The same applies when the new version of the website is deployed or configuration changed. Monitoring and maintenance of the background thread in IIS worker process would be probably more difficult than a separate Windows Service.

Categories : Asp Net

Mongodb exists after claiming that there is no disk space while disk was not full
This is a bug in MongoDB. As of today it remains unresolved. The best advice I can give you is to ensure you have plenty of available disk space at all times.

Categories : Mongodb

OSX Terminal - Change Application Focus
If I understand you correctly, this could be done quite easily with open -a. Opening an already-open application brings it to the forefront. The -a option allows you to specify the application you want, so pick your favorite: open -a Google Chrome open -a Safari open -a Firefox

Categories : Osx

Custom ClassLoader uses secret key to decrypt pre-encrypted class files (which had been encrypted with the secret key)
You already answered your own question: Your decrypting class loader still has to call defineClass. Anyone can launch your app launcher in their own class loader and simply hand your app launcher a version of java.lang.ClassLoader that will write out anything that is passed to defineClass. There is no way around defineClass (aside from native code, I suppose). If you are so worried about your classes being decompiled you're better off with an obfuscator (ProGuard or the like) or possibly an ahead of time native compiler (GCJ, Jet).

Categories : Java

Forcing server to wait because image haven't finished writing to disk
Let's say UserA uploads a file while UserB browses normally. After UserA uploads a file, does UserB experience the 2 second delay? UserB will only experience a delay if UserB's and UserA's requests are being handled by the same thread, which is not the case since most web servers use a separate thread to handle each connection. Thread.sleep(2000) be the best code to use? No, this is probably not a good way of doing things. Aside from tying up the cpu, you are explicitly having the thread wait 2 seconds before attempting to access the file when you have no guarentee that the file will be ready at that point. It would be better to try leverage Java's wait() and notify() Object methods for concurrency. However, I do not know if that is necessariy since you should know when the

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.