php


Generate rand hash by md5 and sha1


i have used
md5(sha1(rand()))
this will give me 2 levels of encryption and output hash with 32 length like
cbc7a20f14eab9262efe0adb21074d0a
but how i can let hash be 255 length (for example) ?
Whatever you're doing just stop it now.
Calling the same or different cryptographic functions repeatedly does not do anything like give you multiple levels of encryption. If anything, it weakens the encryption by making it easier to find a hash collision.
Moreover, neither md5 nor sha-1 are cryptographically secure.
If you're trying to create passwords, use bcrypt or PBKDF2 (and only once). Don't forget to use a unique salt and high iteration count.
You may use a KBKDF (key based key derivation function) like the ones specified in NIST SP 800-108 or HKDF to expand the output of bcrypt or PBKDF2 into more bytes. Note however that this does not increase the security level to the number of bytes in the output.
If you want to create cryptographic random numbers, anything relying on rand() won't do any good. No matter which hash or KDF you throw at it.
Use mcrypt_create_iv ($size, MCRYPT_DEV_URANDOM) instead, which conventiently has a $size parameter, solving your length problem at the same time.

Related Links

How can I collect all my types into one table in laravel?
PHP Toggle switch with update database
Doctrine ORM, ManyToMany - duplicates on lazy fetch
Save select value onchange Laravel
Symfony Assetic Dump get class not Found Exception
Use Interface as __constructor() parameter
High TTFB after moving WordPress multisite from Windows to Linux
“OnClick” Ajax function on ''IMAP to PHP page''
Should/Must I use PDO::PARAM_NULL when binding a value that is null?
which data types- foreach
csrf_exempt decorator not exempting
Phpunit: how to assert that a file is an image? [duplicate]
Deploying a Vue.js app on DigitalOcean
PDO select all function [duplicate]
Sanitize custom checkout fields data in WooCommerce
Create validation rule which can stop other checks in laravel 5.3

Categories

HOME
rust
libgdx
automapper
freeradius
cucumber
angular-ui-grid
qc
linker
openfoam
haxe
minecraft
selection
clickable-image
locationmanager
rangy
xbap
freertos
cuba-platform
global-variables
android-contacts
mixpanel
office-ui-fabric
libgit2
weex
workday
hdl
acl
managed-c++
introspection
webviewclient
spring-annotations
splunk-query
source-insight
tightvnc
epplus
db2-luw
dreamfactory
nppexec
formsauthenticationticket
google-now
microkernel
utf
secure-coding
vungle-ads
elasticsearch-aggregation
julius-speech
moinmoin
absolute
swift2.3
android-5.0-lollipop
sharpdx
watir-webdriver
wikimapia
allegro
rational-performance-test
django-testing
msbuild-4.0
xcode8-beta4
wepay
pack
ui4j
outlook.com
google-maps-api-2
ibm-was
lowercase
auto-generate
pythonxy
espresso
modern.ie
erlog
scala-swing
fasterxml
lifetime
n-tier-architecture
cakephp-2.2
jquery-mobile-flipswitch
mobile-country-code
lumia-imaging-sdk
siena
stripe.net
zend-search-lucene
cloo
django-settings
xsd2code
mousemotionlistener
iirf
jacob
sunstudio
background-thread
django-filebrowser
office-app
playorm
websphere-6.1
thejit
trialware
wcf-callbacks
sigar
snackjs
azure-acs
css-friendly
ognl
eai
remote-working
jvm-bytecode
synthesizer

Resources

Encrypt Message