I use the method mentioned here "Is there a package to secure rendered pdf with a password?".
\special{pdf:encrypt ownerpw (abc) userpw (xyz) length 128 perm 2052}
\documentclass{article}
\begin{document}
This is a test.
\end{document}
Tested:
Win7 64bit + MiKTeX 2.9 32bit
Did not use the owner password "abc" to encrypt the pdf, but the user password "xyz" by setting.
miktex-dvipdfmx.exe Version:
This is xdvipdfmx Version 20160619 by the DVIPDFMx project team, modified for TeX Live and MiKTeX, an extended version of DVIPDFMx, which in turn was an extended version of dvipdfm-0.13.2c developed by Mark A. Wicks. Copyright (C) 2002-2016 the DVIPDFMx project team Copyright (C) 2006-2016 SIL International. This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.macOS 10.12 + MacTeX-2016
The problem is the same as above.
dvipdfmx Version:
This is dvipdfmx Version 20160307 by the DVIPDFMx project team, modified for TeX Live, an extended version of dvipdfm-0.13.2c developed by Mark A. Wicks. Copyright (C) 2002-2016 the DVIPDFMx project team Copyright (C) 2006-2016 SIL International. This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.There is no problem with the cloud.sagemath.com platform.
Compile command:
latexmk -xelatex -f -g -bibtex -synctex=1 --enable-write18 -interaction=nonstopmode 'text.tex'dvipdfmx Version:
This is dvipdfmx Version 20150315 by the DVIPDFMx project team, modified for TeX Live, an extended version of dvipdfm-0.13.2c developed by Mark A. Wicks. Copyright (C) 2002-2015 the DVIPDFMx project team Copyright (C) 2006 SIL International. This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.There is no such problem with the www.sharelatex.com platform.