Commit 42620614 authored by Bhavesh Yadav's avatar Bhavesh Yadav

Added strong collision

parent 333549d6
a="" a=""
b="efbc" b="efbc"
iter=0
a=$(openssl dgst -md5 doc2.txt | awk '{print $2}' | cut -c1-4)
until [ "$a" == "$b" ];do until [ "$a" == "$b" ];do
sed -i 's\$\ \' doc2.txt iter=$(($iter+1))
sed -i 's\$\ \' doc1.txt
a=$(openssl dgst -md5 doc2.txt | awk '{print $2}' | cut -c1-4) a=$(openssl dgst -md5 doc2.txt | awk '{print $2}' | cut -c1-4)
done done
echo $iter
\ No newline at end of file
hash=""
origHash=()
iter=1
until [ "$iter" == 10 ];do
filename="doc1"$(($iter+1))".txt"
inputfile="doc1"$iter".txt"
sed 's/\(.\)/\0 /g' "$inputfile" > "$filename"
hash=$(openssl dgst -md5 "$filename" | awk '{print $2}' | cut -c1-4)
origHash+=($hash)
iter=$(($iter+1))
done
echo "${origHash[*]}"
# a=$(openssl dgst -md5 doc2.txt | awk '{print $2}' | cut -c1-4)
containsElement () {
local e match="$1"
shift
for e; do [[ "$e" == "$match" ]] && return 0; done
return 1
}
iter=0
val=1
until [ "$val" == 0 ];do
iter=$(($iter+1))
sed -i 's\$\ \' doc1.txt
hash=$(openssl dgst -md5 doc2.txt | awk '{print $2}' | cut -c1-4)
containsElement "$hash" "${origHash[@]}"
val=$?
done
echo $iter
Office Order
Permission granted to Agent Z for procument of 100 desktop computers for the organization.
- Gabbar
O f f i c e O r d e r
P e r m i s s i o n g r a n t e d t o A g e n t Z f o r p r o c u m e n t o f 1 0 0 d e s k t o p c o m p u t e r s f o r t h e o r g a n i z a t i o n .
- G a b b a r
O f f i c e O r d e r
P e r m i s s i o n g r a n t e d t o A g e n t Z f o r p r o c u m e n t o f 1 0 0 d e s k t o p c o m p u t e r s f o r t h e o r g a n i z a t i o n .
- G a b b a r
O f f i c e O r d e r
P e r m i s s i o n g r a n t e d t o A g e n t Z f o r p r o c u m e n t o f 1 0 0 d e s k t o p c o m p u t e r s f o r t h e o r g a n i z a t i o n .
- G a b b a r
O f f i c e O r d e r
P e r m i s s i o n g r a n t e d t o A g e n t Z f o r p r o c u m e n t o f 1 0 0 d e s k t o p c o m p u t e r s f o r t h e o r g a n i z a t i o n .
- G a b b a r
O f f i c e O r d e r
P e r m i s s i o n g r a n t e d t o A g e n t Z f o r p r o c u m e n t o f 1 0 0 d e s k t o p c o m p u t e r s f o r t h e o r g a n i z a t i o n .
- G a b b a r
O f f i c e O r d e r
P e r m i s s i o n g r a n t e d t o A g e n t Z f o r p r o c u m e n t o f 1 0 0 d e s k t o p c o m p u t e r s f o r t h e o r g a n i z a t i o n .
- G a b b a r
O f f i c e O r d e r
P e r m i s s i o n g r a n t e d t o A g e n t Z f o r p r o c u m e n t o f 1 0 0 d e s k t o p c o m p u t e r s f o r t h e o r g a n i z a t i o n .
- G a b b a r
O f f i c e O r d e r
P e r m i s s i o n g r a n t e d t o A g e n t Z f o r p r o c u m e n t o f 1 0 0 d e s k t o p c o m p u t e r s f o r t h e o r g a n i z a t i o n .
- G a b b a r
O f f i c e O r d e r
P e r m i s s i o n g r a n t e d t o A g e n t Z f o r p r o c u m e n t o f 1 0 0 d e s k t o p c o m p u t e r s f o r t h e o r g a n i z a t i o n .
- G a b b a r
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment