This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 433582 - mcrypt performance on F8 so slow on large files as to be useless
mcrypt performance on F8 so slow on large files as to be useless
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: mcrypt (Show other bugs)
8
All Linux
low Severity high
: ---
: ---
Assigned To: Tom "spot" Callaway
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-19 23:58 EST by Jeff Schultz
Modified: 2008-09-15 06:35 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-09-10 02:52:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Jeff Schultz 2008-02-19 23:58:10 EST
Description of problem:

New bug for performance problem mentioned in
https://bugzilla.redhat.com/show_bug.cgi?id=418481

Current F8 on AMD64.  mcrypt takes impossibly long times on file much greater
than 10MB.  Decryption is fine, but encryption seems to be severely non-linear
in size of file.


Version-Release number of selected component (if applicable):

mcrypt-2.6.7-1.fc8
libmcrypt-2.5.8-4.fc8


How reproducible:

Completely.

Steps to Reproduce:

yes |head -c 1000000 >y6
yes |head -c 10000000 >y7
yes |head -c 100000000 >y8 

for i in y? ; do time mcrypt -k x <$i |wc -c; done

Warning: It is insecure to specify keywords in the command line
Stdin was encrypted.
1000051

real    0m0.226s
user    0m0.182s
sys     0m0.044s
Warning: It is insecure to specify keywords in the command line
Stdin was encrypted.
10000051

real    0m5.694s
user    0m3.368s
sys     0m2.235s
Warning: It is insecure to specify keywords in the command line

Note that the 100MB file y8 is still going after many minutes.

Compare the same with mcrypt-2.6.4-3.fc8:

Warning: It is insecure to specify keywords in the command line
1000109
Stdin was encrypted.

real    0m0.142s
user    0m0.133s
sys     0m0.007s
Warning: It is insecure to specify keywords in the command line
10000109
Stdin was encrypted.

real    0m0.985s
user    0m0.954s
sys     0m0.025s
Warning: It is insecure to specify keywords in the command line
100000109
Stdin was encrypted.

real    0m6.154s
user    0m5.868s
sys     0m0.152s

Much faster, and the 100MB file is successfully encrypted.
  
Actual results:

Doesn't work for large files.

Expected results:

Works for large files.

Additional info:
Comment 1 Tom "spot" Callaway 2008-08-26 08:18:19 EDT
Between 2.6.5 and 2.6.6, the default encryption mechanism changed from mcrypt's internal method to openpgp.

http://mcrypt.cvs.sourceforge.net/mcrypt/mcrypt/src/mcrypt.gaa?r1=1.1&r2=1.2

Passing --no-openpgp confirms this:

[spot@localhost mcrypt-2.6.6]$ for i in y? ; do time /usr/bin/mcrypt --no-openpgp -k x <$i |wc -c; done
Warning: It is insecure to specify keywords in the command line
1000109
Stdin was encrypted.

real	0m0.056s
user	0m0.033s
sys	0m0.013s
Warning: It is insecure to specify keywords in the command line
10000109
Stdin was encrypted.

real	0m0.399s
user	0m0.317s
sys	0m0.056s
Warning: It is insecure to specify keywords in the command line
100000109
Stdin was encrypted.

real	0m3.637s
user	0m3.160s
sys	0m0.459s
[spot@localhost mcrypt-2.6.6]$

Given the significant shortcomings of openpgp, I don't think it should be the default, so I've patched it to not be (patch also sent upstream, see: http://sourceforge.net/tracker/index.php?func=detail&aid=2075758&group_id=87941&atid=584895). You should see updates coming shortly.
Comment 2 Fedora Update System 2008-08-26 14:57:30 EDT
mcrypt-2.6.7-3.fc8,libmcrypt-2.5.8-6.fc8 has been submitted as an update for Fedora 8.
http://admin.fedoraproject.org/updates/mcrypt-2.6.7-3.fc8,libmcrypt-2.5.8-6.fc8
Comment 3 Fedora Update System 2008-08-26 14:59:07 EDT
libmcrypt-2.5.8-6.fc9,mcrypt-2.6.7-3.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/libmcrypt-2.5.8-6.fc9,mcrypt-2.6.7-3.fc9
Comment 4 Fedora Update System 2008-09-10 02:52:52 EDT
mcrypt-2.6.7-3.fc8, libmcrypt-2.5.8-6.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 5 Fedora Update System 2008-09-10 02:53:45 EDT
libmcrypt-2.5.8-6.fc9, mcrypt-2.6.7-3.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 6 Jeff Schultz 2008-09-15 06:35:35 EDT
Tested.  Works now.  Much appreciated.

Note You need to log in before you can comment on or make changes to this bug.