473,841 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Python To Create An Encrypted Container

Is it possible? Bestcrypt can supposedly be set up on linux, but it seems
to need changes to the kernel before it can be installed, and I have no
intention of going through whatever hell that would cause.

If I could create a large file that could be encrypted, and maybe add
files to it by appending them and putting in some kind of delimiter
between files, maybe a homemade version of truecrypt could be constructed.

Any idea what it would take?

Apr 16 '06 #1
5 6782
Michael Sperlle <sp*****@yahoo. com> writes:
If I could create a large file that could be encrypted, and maybe add
files to it by appending them and putting in some kind of delimiter
between files, maybe a homemade version of truecrypt could be constructed.
Any idea what it would take?


If by container you mean a user-level file system with transparent
encryption, there are a bunch of ways to do it, but it's system
hacking, Python doesn't come into it much. If you just want an
encrypted archive, then put your files into a normal zip file and
encrypt the zip file.
Apr 16 '06 #2
Michael Sperlle <sp*****@yahoo. com> wrote:
Is it possible? Bestcrypt can supposedly be set up on linux, but it seems
to need changes to the kernel before it can be installed, and I have no
intention of going through whatever hell that would cause.

If I could create a large file that could be encrypted, and maybe add
files to it by appending them and putting in some kind of delimiter
between files, maybe a homemade version of truecrypt could be constructed.

Any idea what it would take?


you can either use fuse and its python bindings - this is rather trivial
filesystem-wise, of course there are challenges in order to implement
encryption effectively and efficiently (this is what encfs or phonebook
do, but they are written in C)

Or implement encrypted network block device in python - again, this
should not be _that_ hard.

Or implement either nfs or samba server with transparent encrypted
storage - this is what (again in C) cfs does. If you go the samba way,
it would be even cross-platform - but I have no idea how difficult it
would be to implement a samba server in python.

In all the cases, performance is going to be THE issue.

--
-----------------------------------------------------------
| Radovan GarabÃ*k http://kassiopeia.juls.savba.sk/~garabik/ |
| __..--^^^--..__ garabik @ kassiopeia.juls .savba.sk |
-----------------------------------------------------------
Antivirus alert: file .signature infected by signature virus.
Hi! I'm a signature virus! Copy me into your signature file to help me spread!
Apr 16 '06 #3
On Sun, 16 Apr 2006 08:11:12 -0700, Paul Rubin wrote:
Michael Sperlle <sp*****@yahoo. com> writes:
If I could create a large file that could be encrypted, and maybe add
files to it by appending them and putting in some kind of delimiter
between files, maybe a homemade version of truecrypt could be
constructed. Any idea what it would take?


If by container you mean a user-level file system with transparent
encryption, there are a bunch of ways to do it, but it's system hacking,
Python doesn't come into it much. If you just want an encrypted archive,
then put your files into a normal zip file and encrypt the zip file.


I've tried that, but the encryption and decryption take a long time
compared to opening/closing the container, once it's made.

The only other thing I can think of is making it non-readable for anyone
except root, but have the feeling that's not too secure.
Apr 16 '06 #4
Am Sonntag 16 April 2006 19:11 schrieb Michael Sperlle:
The only other thing I can think of is making it non-readable for anyone
except root, but have the feeling that's not too secure.


Huh? If you don't trust your operating system to correctly validate
file-permissions for you (on a server, on a client system which can be booted
by others than you or from which the physical harddisk can be extracted the
security implications are completely different), you're in absolutely no
position to even want encryption, because any malicious user can replace your
encryption code with code of his own, so that it's easily breakable by him.

Of course there are temporary local priviledge escalations (in some
applications, or even in the kernel of your operating system), but if you
rely on the operating system to keep your encryption code secure, you might
as well rely on the operating system to keep your data secure, because that's
basically the same thing.

--- Heiko.
Apr 16 '06 #5
>>>>> "Michael" == Michael Sperlle <sp*****@yahoo. com> writes:

Michael> Is it possible? Bestcrypt can supposedly be set up on
Michael> linux, but it seems to need changes to the kernel before
Michael> it can be installed, and I have no intention of going
Michael> through whatever hell that would cause.

Michael> If I could create a large file that could be encrypted,
Michael> and maybe add files to it by appending them and putting
Michael> in some kind of delimiter between files, maybe a homemade
Michael> version of truecrypt could be constructed.

One problem in using a large file which is encrypted is that a single
byte error can destroy all your data (see DEDICATION below). I wrote
a little python module called hashtar that works like tar, but
encrypts every file independently in a flattened dir structure with
filename hiding. It stores the file permissions, dir structure, and
ownership in an encrypted header of each encrypted file after first
padding some random data at the top to reduce the risk of known
plaintext attacks.

Here is some example usage
hashtar.py -cvf numeric.htar numeric Password:
Confirm:
numeric/__init__.py -> numeric.htar/1a/1a9f48d439144d1 fa33b186fa49a6b 63
numeric/contiguous_demo .py -> numeric.htar/8a/8a7757bf6f4a20e 6904173f7c597eb 45
numeric/diff_dmo.py -> numeric.htar/0c/0cea827761aef0c cfc55a869dd2aeb 38
numeric/fileio.py -> numeric.htar/3e/3e50f59a1d2d873 07c585212fb84be 6a
numeric/find -> numeric.htar/b1/b1070de08f4ea53 1f10abdc58cfe8e dc
...snip
find numeric.htar|he ad numeric.htar
numeric.htar/1a
numeric.htar/1a/1a9f48d439144d1 fa33b186fa49a6b 63
numeric.htar/8a
numeric.htar/8a/8a7757bf6f4a20e 6904173f7c597eb 45
numeric.htar/8a/8a4343ba60feda8 55fbaf8132e9b5a 6b
numeric.htar/8a/8a72457096828c8 d509ece6520e49d 0b
numeric.htar/0c
numeric.htar/0c/0cea827761aef0c cfc55a869dd2aeb 38
numeric.htar/3e

hashtar.py -tvf numeric.htar Password:
131 numeric/__init__.py
594 numeric/contiguous_demo .py
26944 numeric/Quant.pyc
209 numeric/extensions/test/rpm_build.sh
230 numeric/diff_dmo.py
439 numeric/fileio.py

It works across platforms (win32, OSX and linux tested), so files
encrypted on one will decrypt on others.

All the code lives in a single file (hashtar.py) included below.

See also the WARNING below (hint -- I am not a cryptographer)

#!/usr/bin/env python
"""
OVERVIEW

hashtar: an encrypted archive utility designed for secure archiving
to media vulnerable to corruption.

Recursively encrypt the files and directories passed as arguments.
Rather than preserving the directory structure, or archiving to a
single file as in tar, the files are encrypted to a single dir and
named with the hash of their relative path. The file information
(filename, permission mode, uid, gid) is encrypted and stored in the
header of the file itself, and can be used to restore the original
file with dir structure from the archive file. For example, the
command
hashtar.py -cvf tmp.htar finance/
prompts for a password and generates an encrypted recursive archive
of the finance dir in the tmp.htar dir, with filenames mapped like

finance/irs/98/f1040.pdf -> tmp.htar/e5/e5ed546c0bc0191 d80d791bc2f73c8 90
finance/sale_house/notes -> tmp.htar/58/580e89bad7563ae 76c295f75aecea0 30
finance/online/accounts.gz.mcr -> tmp.htar/bb/bbf12f06dc3fcee 04067d40b9781f4 a8
finance/phone/prepaid1242.doc -> tmp.htar/c1/c1fe52a9d8cbef5 5eff8840d379d97 2a

The encrypted files are placed in subdirs based on the first two
characters in their hash name because if too many files are placed
in one dir, it may not be possible to pass all of them as command
line arguments to the restore command. The entire finance dir
structure can later be restored with
hashtar.py -xvf tmp.htar
The advantage of this method of encrypted archiving, as opposed to
archiving to a single tar file and encrypting it, is that this
method is not sensitive to single byte corruption, which becomes
important especially on externally stored archives, such as on CDR,
or DVDR. Any individual file contains all the information needed to
restore itself, with directory structure, permission bits, etc. So
only the specific files that are corrupted on the media will be
lost.

The alternative strategy, encrypting all the files in place and then
archiving to external media, doesn't suffer from single byte
corruption but affords less privacy since the filenames, dir
structure, and permission bits are available, and less security
since a filename may indicate contents and thus expose the archive
to a known plaintext attack.

A match string allows you to only extract files matching a given
pattern. Eg, to only extract pdf and xls files, do
hashtar.py -m pdf,xls -xvf tmp.htar
Because the filenames are stored in the header, only a small portion
of the file needs to be decrypted to determine the match, so this is
quite fast.

Data can be encrypted and decrypted across platforms (tested between
linux and win32 and vice-versa) but of course some information may
be lost, such as uid, gid for platforms that don't support it.

USAGE:
hashtar.py [OPTIONS] files
OPTIONS

-h, --help Show help message and exit
-fDIR, --arcdir=DIR Write hashed filenames to archive dir
-pFILE, --passwdfile=FILE
Get passwd from FILE, otherwise prompt
-mPATTERN, --match=PATTERN
Only extract files that match PATTERN.
PATTERN is a comma separated list of strings,
one of which must match the filename
-u, --unlink Delete files after archiving them
-c, --create Create archive dir
-t, --tell Report information about files
-x, --extract Extract files recursively from archive dir
-v, --verbose Verbose listing of filenames to stdout

WARNING:

I think this software is suitable to protect your data from your
sister, your boss, and even the nosy computer hacker next door, but
not the NSA.

REQUIREMENTS:

python2.3 - python.org
yawPyCrypto and Flatten - http://yawpycrypto.sourceforge.net/
pycrypto - http://www.amk.ca/python/code/crypto.html

The python dependencies are very easy to install; just do the usual python setup.py install

PLATFORMS:

Tested on linux and win32

AUTHOR:

John D. Hunter <jd******@ace.b sd.uchicago.edu >

LICENSE:

same as python2.3

KNOWN BUGS:

Ignores symbolic links

DEDICATION:

For Erik Curiel, who's life's work I lost when I volunteered to
backup the only copy of his home dir on a CD containing a single
encrypted gzipped tar file, which was subsequently corrupted.

"""

import sys, os, random, struct, csv, time, glob
from md5 import md5
from optparse import OptionParser
from cStringIO import StringIO
from getpass import getpass
#def getpass(arg): pass
from yawPyCrypto.Cip her import DecryptCipher, EncryptCipher
from yawPyCrypto.Cip her import ZipDecryptCiphe r, ZipEncryptCiphe r
from yawPyCrypto.Con stants import CIPHER_BLOWFISH , MODE_CBC

version = 0.3
pathsep = os.path.join('. ','')[1:] # is there a better way to get this?

def encrypt_str(pas swd, s, enc=None):
"""
Encrypt the string s using passwd and encryption cipher enc
"""
if enc is None:
enc = ZipEncryptCiphe r(passwd, CIPHER_BLOWFISH , MODE_CBC)
enc.feed(s)
enc.finish()
return enc.data

def decrypt_str(pas swd, s, dec=None):
"""
Decrypt the string s using passwd and encryption cipher enc
"""
if dec is None:
dec = ZipDecryptCiphe r(passwd)
dec.feed(s)
dec.finish()
return dec.data

def ends_with_paths ep(fname):
"""
Return true if string fname ends in a path separator string
"""
head, tail = os.path.split(f name)
return tail == ''
junk = list('abcdefghi jklmnopqrstuvwy zABCDEFGHIJKLMN OPQRSTUVWXYZ012 3456789_- /\\.\n'*20)
numJunk = 200

def info_to_str(inf o):
"""
info is a fname, mode, uid, gid tuple

Return a string for storage in the encrypted archive outfile
"""
global junk
# Here is the real info string
sh = StringIO()
writer = csv.writer(sh)
writer.writerow (info)
s = sh.getvalue()

# because the info string will be fed thru zlib before encryption,
# I'm prepending numJunk garbage characters at the beginning of
# the key string to make it difficult for someone trying to do a
# known plaintext attack on the key file given that the info
# contains plain text that might be guessed and plain text that is
# common between archive file (such as base path names).
random.shuffle( junk)
junkStr = ''.join(junk[:numJunk])

return junkStr + s

def str_to_info(s):
"""
Takes string and returns (fname, mode, uid, gid)
"""
sh = StringIO(s[numJunk:])
reader = csv.reader(sh)
for row in reader:
fname,mode,uid, gid = row
return fname, int(mode), int(uid), int(gid)
def encode(infile, arcdir, passwd, unlink=0, verbose=0, endian='little' ):
"""
Encrypt the file infile and hash it's filename to arcdir

- infile: the input filename
- arcdir is the dir that the files where the hashed filenames will
be placed
- passwd is the encryption passwd as string
- unlink, if true, will try to remove the src file after
archiving it

"""

if not os.path.exists( infile):
print >> sys.stderr, '%s does not exist: skipping' % infile
return
if os.path.isdir(i nfile):
# mark dirs with pathsep at the end if they don't have one
head, tail = os.path.split(i nfile)
if not ends_with_paths ep(infile):
infile = os.path.join(in file, '')

m = md5(infile)
hd = m.hexdigest()
tup = os.stat(infile)

if pathsep=='/': storeName = infile
else: storeName = '/'.join(infile.s plit(pathsep))
s = info_to_str( (storeName, tup.st_mode, tup.st_uid, tup.st_gid) )
s = encrypt_str(pas swd, s)

outdir = os.path.join(ar cdir, hd[:2])
if not os.path.isdir(o utdir): os.mkdir(outdir , 0700)
outfile = os.path.join(ou tdir, hd)

oh = file(outfile, 'wb')

if endian=='little ': fmt = '<'
else: fmt = '>'

oh.write(struct .pack(fmt+'fI', version, len(s)))
oh.write(s)

if verbose: print '%s -> %s' % (infile, outfile)
if os.path.isdir(i nfile): return 1 # nothing more to do for dirs

ih = file(infile, 'rb')
enc = EncryptCipher(p asswd, CIPHER_BLOWFISH , MODE_CBC)
while 1:
data = ih.read(1024)
if len(data)==0: break
enc.feed(data)
oh.write(enc.da ta)
enc.finish()
oh.write(enc.da ta)
ih.close()
oh.close()

if unlink:
try: os.remove(infil e)
except OSError, msg:
print >> sys.stderr, 'Could not remove', fname
print >> sys.stderr, msg
return 1

def decode(infile, passwd, unlink=0, verbose=0, match=None, endian='little' ):
"""
Restore the original file system from the archive dir

- keys is a list of file information tuples; see str_to_keys.
- arcdir is the dir that the files with hashed filenames live
- passwd is the decryption passwd as string
- unlink, if true, will try to remove the archice file after
restoring it

"""

ih = file(infile, 'rb')
if endian=='little ': fmt = '<'
else: fmt = '>'

thisVersion, lenHeader = struct.unpack(f mt+'fI', ih.read(8))
if lenHeader>2000:
print '%s header size %d too large; aborting (try flipping endian)'%(infil e, lenHeader)
sys.exit()

try: header = decrypt_str(pas swd, ih.read(lenHead er))
except MemoryError, msg:
print >>sys.stderr, 'Could not decode %s; skipping' % infile
return 0
except ValueError, msg:
print >>sys.stderr, 'Could not decode %s; bad passwd or file?' % infile
print >>sys.stderr, '\t', msg
return 0
fname, mode, uid, gid = str_to_info(hea der)

if match is not None:
for pattern in match.split(',' ):
if fname.find(patt ern)!=-1: break
else: return 0

if verbose: print '%s -> %s' % (infile,fname)
if ends_with_paths ep(fname): # it's a dir
if not os.path.isdir(f name):
os.makedirs(fna me)
os.chmod(fname, mode)
try: os.chown(fname, uid, gid)
except AttributeError, msg: pass
except OSError, msg: pass # if coming from win32, uid,gid=0

return 1 # nothing more to do

thedir, thename = os.path.split(f name)
if not os.path.isdir(t hedir) and len(thedir): os.makedirs(the dir)

dec = DecryptCipher(p asswd)
oh = file(fname, 'wb')

while 1:
data = ih.read(1024)
if len(data)==0: break
dec.feed(data)
oh.write(dec.da ta)
dec.finish()
oh.write(dec.da ta)
ih.close()
oh.close()

os.chmod(fname, mode)
try: os.chown(fname, uid, gid)
except AttributeError: pass
except OSError, msg: pass # if coming from win32, uid,gid=0

if unlink:
try: os.remove(infil e)
except OSError, msg:
print >> sys.stderr, 'Could not remove', infile
def tell(infile, passwd, verbose=0, endian='little' ):
"""
Report the information about infile
"""

if endian=='little ': fmt = '<'
else: fmt = '>'

ih = file(infile, 'rb')
thisVersion, lenHeader = struct.unpack(f mt+'fI', ih.read(8))
if lenHeader>2000:
print '%s header size %d too large; aborting (try flipping endian)'%(infil e, lenHeader)
sys.exit()
try: header = decrypt_str(pas swd, ih.read(lenHead er))
except MemoryError, msg:
print >>sys.stderr, 'Could not decode %s; skipping' % infile
return 0
except ValueError, msg:
print >>sys.stderr, 'Could not decode %s; bad passwd or file?' % infile
print >>sys.stderr, '\t', msg
return 0
size = os.path.getsize (infile)-lenHeader
fname, mode, uid, gid = str_to_info(hea der)

print '%d\t%s'%(size, fname)
def getpass2():
"""
Prompt for a passwd twice, returning the string only when they
match
"""
p1 = getpass('Passwo rd: ')
p2 = getpass('Confir m: ')
if p1!=p2:
print >> sys.stderr, '\nPasswords do not match. Try again.\n'
return getpass2()
else:
return p1

def listFiles(root, patterns='*', recurse=1, return_folders= 0):
# from Parmar and Martelli in the Python Cookbook
import os.path, fnmatch
# Expand patterns from semicolon-separated string to list
pattern_list = patterns.split( ';')
# Collect input and output arguments into one bunch
class Bunch:
def __init__(self, **kwds): self.__dict__.u pdate(kwds)
arg = Bunch(recurse=r ecurse, pattern_list=pa ttern_list,
return_folders= return_folders, results=[])

def visit(arg, dirname, files):
# Append to arg.results all relevant files (and perhaps folders)
for name in files:
fullname = os.path.normpat h(os.path.join( dirname, name))
if arg.return_fold ers or os.path.isfile( fullname):
for pattern in arg.pattern_lis t:
if fnmatch.fnmatch (name, pattern):
arg.results.app end(fullname)
break
# Block recursion if recursion was disallowed
if not arg.recurse: files[:]=[]

os.path.walk(ro ot, visit, arg)

return arg.results

def get_recursive_f ilelist(args):
"""
Recurs all the files and dirs in args ignoring symbolic links and
return the files as a list of strings
"""
files = []

for arg in args:
if os.path.isfile( arg):
files.append(ar g)
continue
if os.path.isdir(a rg):
newfiles = listFiles(arg, recurse=1, return_folders= 1)
files.extend(ne wfiles)

return [f for f in files if not os.path.islink( f)]
if __name__=='__ma in__':
parser = OptionParser()

parser.add_opti on("-f", "--arcdir", dest="arcdir",
help="Write hashed filenames to archive dir",
metavar="DIR",
default=os.getc wd())

parser.add_opti on("-e", "--endian", dest="endian",
help="big|littl e",
default="little ")
parser.add_opti on("-p", "--passwdfile", dest="passwdfil e",
help="Get passwd from FILE, otherwise prompt",
metavar="FILE", default=None)

parser.add_opti on("-m", "--match", dest="match",
help="Only extract files that match PATTERN. PATTERN is a comma separated list of strings, one of which must match the filename",
metavar="PATTER N", default=None)

parser.add_opti on("-u", "--unlink",
action="store_t rue", dest="unlink", default=False,
help="Delete files after archiving them")

parser.add_opti on("-c", "--create",
action="store_t rue", dest="create", default=False,
help="Create archive dir")

parser.add_opti on("-x", "--extract",
action="store_t rue", dest="extract", default=False,
help="Extract files recursively from archive dir")

parser.add_opti on("-t", "--tell",
action="store_t rue", dest="tell", default=False,
help="Report information about file but do not extract")

parser.add_opti on("-v", "--verbose",
action="store_t rue", dest="verbose", default=False,
help="Verbose listing of filenames to stdout")

(options, args) = parser.parse_ar gs()

if options.create and options.extract :
print >>sys.stderr, 'Cannot create and extract archive simultaneously! '
sys.exit()
if not( options.create or options.extract or options.tell):
print >>sys.stderr, 'You must specify either -c or -x!'
sys.exit()

if os.path.exists( options.arcdir) and not os.path.isdir(o ptions.arcdir):
print '%s exists and is not a dir' % options.arcdir

if not os.path.exists( options.arcdir) :
os.makedirs(opt ions.arcdir)

if options.passwdf ile is not None:
passwd = file(options.pa sswdfile, 'rb').read()
else:
if options.create: passwd = getpass2()
else: passwd = getpass()

if options.extract :
if len(args)==0:
args = [options.arcdir]
files = get_recursive_f ilelist(args)

for thisFile in files:
head, tail = os.path.split(t hisFile)
if not os.path.isfile( thisFile): continue
if not len(tail)==32:
print >>sys.stderr, '%s does not look like a hashname; skipping' % thisFile
continue
decode(thisFile , passwd,
unlink=options. unlink,
verbose=options .verbose,
match=options.m atch,
endian=options. endian
)
elif options.tell:
if len(args)==0:
args = [options.arcdir]
files = get_recursive_f ilelist(args)

for thisFile in files:
head, tail = os.path.split(t hisFile)
if not os.path.isfile( thisFile): continue
if not len(tail)==32:
print >>sys.stderr, '%s does not look like a hashname; skipping' % thisFile
continue
tell(thisFile, passwd, verbose=options .verbose, endian=options. endian)

else:

if sys.platform==' win32':
# do glob expansion manually
expand = []
for arg in args:
expand.extend(g lob.glob(arg))
args = expand
files = get_recursive_f ilelist(args)
for thisFile in files:
encode(thisFile , options.arcdir, passwd,
unlink=options. unlink,
verbose=options .verbose,
endian=options. endian)

Apr 17 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6044
by: Joe Ray | last post by:
I am interested in passing encrypted HTML form data to a JSP page where it is than decrypted. Can someone suggest a technique to do this and the technology or encryption method I should use. If you have any web resources I would appreciate that as well. Thanx in advance. Ray
3
437
by: Steve Mauldin | last post by:
I came across an example in the MSDN documentation using RC2 encryption(the link to the article is at the end of this message). When I tried it I had a problem with getting back the same length string that I sent into it. After working on Debugging the code I found two problems. One was in the statement fromEncrypt = New Byte(encrypted.Length) {} where both FromEncrypt and encrypted are both byte arrays and encrypted's length is 24....
2
1890
by: Martin v. Löwis | last post by:
I've been working on PEP 353 for some time now. Please comment, in particular if you are using 64-bit systems. Regards, Martin PEP: 353 Title: Using ssize_t as the index type Version: $Revision: 42333 $
77
3976
by: Ben Finney | last post by:
Howdy all, PEP 354: Enumerations in Python has been accepted as a draft PEP. The current version can be viewed online: <URL:http://www.python.org/peps/pep-0354.html> Here is the reStructuredText source as it is today. Please discuss it here so I can see what issues people may have.
2
3185
by: fineman | last post by:
Hi all, I want to get a 64bit(8 bytes) Encrypt result use DES class in the VS2005. Though I encrypt data is 64bit(8 bytes), but DES return encrypt result that always is 128bit(16 bytes), I don't know why? How to get a 64bit(8 bytes) encrypt result using DES class in the VS2005?
122
7511
by: Edward Diener No Spam | last post by:
The definition of a component model I use below is a class which allows properties, methods, and events in a structured way which can be recognized, usually through some form of introspection outside of that class. This structured way allows visual tools to host components, and allows programmers to build applications and libraries visually in a RAD environment. The Java language has JavaBeans as its component model which allows Java...
26
9347
by: myeates | last post by:
Hi Anyone ever done this? It looks like Python2.4 won't take a length arg Mathew
18
7187
by: Franz Steinhaeusler | last post by:
Hello, I did not find any reasonable pyhton source code beautifier program (preferable gui). Some would ask why? Program it immediatly good. (BTW: Would be a nice project, if I would have more spare time). Ich have some foreign source, which are programed in a way I don't like, so I would like to have a tool, which automatically processes following options:
3
8311
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0 build with these methods, will appear to encrypt and decrypt, but the resulting decrypted file will be corrupted. I tried encrypting a .bmp file and then decrypting, the resulting decrypted file under .NET 2.0 is garbage, the .NET 1.1 build works...
0
9703
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10609
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10302
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7846
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7024
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4081
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3140
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.